From 67c1ce15dd1ad4170e9ad459c9e93942e60a2ae3 Mon Sep 17 00:00:00 2001 From: Roni Dover Date: Wed, 18 May 2016 23:05:48 +0300 Subject: [PATCH] adding more tests --- tests/docker_driver_tests.py | 48 +++++++++++++++++++++++++++++++++--- tests/test_requirements.txt | 1 + 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 tests/test_requirements.txt diff --git a/tests/docker_driver_tests.py b/tests/docker_driver_tests.py index a5dc26d..05f546a 100644 --- a/tests/docker_driver_tests.py +++ b/tests/docker_driver_tests.py @@ -3,8 +3,50 @@ from dockerhostdriver import DockerHostDriver -class DescribeDockerHostDriver (TestCase): +class DockerApiService(object): - def test_it_can_be_initialized(self): + def get_address_information(self, container_id): + #some implementation of which APIs to call..: + + + +class DescribeDockerHostDriverRefreshIP (TestCase): + + def it_can_be_initialized(self): driver = DockerHostDriver() - self.assertIsNotNone(driver, "Driver can't be none") \ No newline at end of file + self.assertIsNotNone(driver, "Driver can't be none") + + + def it_gets_the_ip_from_the_container(self): + + context=None + ports = '' + + docker_api_service = DockerApiService() + + driver = DockerHostDriver(docker_api_service) + + #Given I have a docker host up with an IP of x + #When I refresh the IP + #The driver should poll the docker API for the IP + + + driver.remote_refresh_ip(context,ports) + + docker_api_service.WasCalled("get_address_information") + + + + + + def it_sets_the_updated_ip_on_the_cloudshell_resource(self): + pass + + def it_gets_specific_port_information_for_each_protocol(self): + pass + + def it_sets_the_specific_port_information_on_the_cloudshell_resource(self): + pass + + def it_returns_an_intelligible_error_message_if_host_is_unreachable(self): + pass diff --git a/tests/test_requirements.txt b/tests/test_requirements.txt new file mode 100644 index 0000000..3864a05 --- /dev/null +++ b/tests/test_requirements.txt @@ -0,0 +1 @@ +requests-mock \ No newline at end of file