def setUp(self): ''' If the cloud info file is not present assume running in a UNITTEST environment. This will allow for exercising some of the code without having to be running in a cloud VM. Set up logging. ''' setup_logging(logging.DEBUG, './test_audrey_startup.log') # Create the client Object self.cs_client = CSClient(**DUMMY_CS_CONFIG) self.cs_client.http = HttpUnitTest()
class TestConfigServerClient(unittest.TestCase): ''' Class for exercising the gets and put to and from the CS ''' def setUp(self): ''' If the cloud info file is not present assume running in a UNITTEST environment. This will allow for exercising some of the code without having to be running in a cloud VM. Set up logging. ''' setup_logging(logging.DEBUG, './test_audrey_startup.log') # Create the client Object self.cs_client = CSClient(**DUMMY_CS_CONFIG) self.cs_client.http = HttpUnitTest() def tearDown(self): pass def test_success_get_cs_configs(self): ''' Success case: - Exercise get_cs_configs() ''' print '\n\n--- Test Name: test_success_get_cs_configs ---' self.cs_client.get_cs_configs() # Add asserts print 'test_success_get_cs_configs() Add asserts' print 'self.cs_client : START \n' + str(self.cs_client) + \ '\nself.cs_client : END' def test_success_get_cs_tooling(self): ''' Success case: - Exercise get_cs_tooling() ''' self.cs_client.get_cs_tooling() def test_success_get_cs_params(self): ''' Success case: - Exercise get_cs_params() ''' print '\n\n--- Test Name: test_success_get_cs_params ---' self.cs_client.get_cs_params() # Add asserts print 'test_success_get_cs_params() Add asserts' print 'self.cs_client : START \n' + str(self.cs_client) + \ '\nself.cs_client : END' def test_success_get_cs_confs_n_params(self): ''' Success case: - Exercise get_cs_configs() and get_cs_params() ''' print '\n\n--- Test Name: test_success_get_cs_confs_and_params ---' self.cs_client.get_cs_configs() self.cs_client.get_cs_params() # Add asserts print 'test_success_get_cs_confs_n_params() Add asserts' print 'self.cs_client : START \n' + str(self.cs_client) + \ '\nself.cs_client : END' print 'test_success_get_cs_confs_n_params() Add asserts' def test_success_put_cs_params_values(self): ''' Success case: - Exercise put_cs_params_values() ''' self.cs_client.put_cs_params_values('') def test_error_http_status(self): ''' Success case: - Exercise put_cs_params_values() ''' self.assertRaises(ASError, self.cs_client._validate_http_status, 401)