def test_config_inits_from_file(self): c = Config(config_file='test/resources/run1.json') self.assertEqual({'type': 'LocalFetcher', 'src': 'testcases'}, c.get_fetcher()) self.assertEqual({'type': 'CaddyPublisher', 'url': 'http://127.0.0.1:8080/uploads'}, c.get_publisher())
def test_config_inits_from_dict(self): c = Config(data=example_mixed) self.assertEqual({'type': 'LocalFetcher', 'src': 'testcases'}, c.get_fetcher()) self.assertEqual({'type': 'CaddyPublisher', 'url': 'http://127.0.0.1:8080/uploads'}, c.get_publisher())
def test_config_loads_fetcher(self): c = Config() data = {'type': 'LocalFetcher', 'src': 'somecontext'} c.load_fetcher(data) self.assertEqual(data, c.get_fetcher())
def test_config_inits(self): c = Config() self.assertEqual({}, c.get_fetcher()) self.assertEqual({}, c.get_publisher()) self.assertIsNone(c.fetcher_callback) self.assertIsNone(c.publisher_callback)