def test_add_environment_var_config_with_missing_variable(self):
     ctxt = {}
     with self.assertRaises(Exception) as context:
         tempest_setup.add_environment_var_config(ctxt, ['swift'])
     self.assertEqual(
         ('Environment variables [TEST_SWIFT_IP] must all be '
          'set to run this test'),
         str(context.exception))
 def test_add_environment_var_config_with_all_variables(
         self, get_deployment_context):
     ctxt = {}
     get_deployment_context.return_value = {
         'TEST_GATEWAY': 'test',
         'TEST_CIDR_EXT': 'test',
         'TEST_FIP_RANGE': 'test',
         'TEST_NAME_SERVER': 'test',
         'TEST_CIDR_PRIV': 'test',
     }
     tempest_setup.add_environment_var_config(ctxt, ['neutron'])
     self.assertEqual(ctxt['test_gateway'], 'test')
 def test_add_environment_var_config_with_some_variables(
         self, get_deployment_context):
     ctxt = {}
     get_deployment_context.return_value = {
         'TEST_GATEWAY': 'test',
         'TEST_NAME_SERVER': 'test',
         'TEST_CIDR_PRIV': 'test',
     }
     with self.assertRaises(Exception) as context:
         tempest_setup.add_environment_var_config(ctxt, ['neutron'])
     self.assertEqual(
         ('Environment variables [TEST_CIDR_EXT, TEST_FIP_RANGE] must '
          'all be set to run this test'), str(context.exception))