Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_load_config(self):
conf = get_fixture('eapi.conf')
pyeapi.client.load_config(conf)
self.assertEqual(len(pyeapi.client.config.sections()), 3)
for name in ['localhost', 'test1', 'test2']:
name = 'connection:%s' % name
self.assertIn(name, pyeapi.client.config.sections())
def test_load_config_env_path(self):
os.environ['EAPI_CONF'] = get_fixture('env_path.conf')
pyeapi.client.config.autoload()
self.assertIn('connection:env_path', pyeapi.client.config.sections())
def test_load_config(self):
conf = get_fixture('eapi.conf')
pyeapi.client.load_config(conf)
self.assertEqual(len(pyeapi.client.config.sections()), 3)
for name in ['localhost', 'test1', 'test2']:
name = 'connection:%s' % name
self.assertIn(name, pyeapi.client.config.sections())
def test_config_always_has_default_connection(self):
conf = '/invalid.conf'
pyeapi.client.load_config(conf)
self.assertEqual(len(pyeapi.client.config.sections()), 1)
name = 'connection:localhost'
self.assertIn(name, pyeapi.client.config.sections())
def test_config_always_has_default_connection(self):
conf = '/invalid.conf'
pyeapi.client.load_config(conf)
self.assertEqual(len(pyeapi.client.config.sections()), 1)
name = 'connection:localhost'
self.assertIn(name, pyeapi.client.config.sections())