示例#1
0
 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())
示例#2
0
 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())
示例#3
0
 def test_config_loads_publisher(self):
     c = Config()
     data = {'type': 'LocalPublisher', 'src': 'somecontext'}
     c.load_publisher(data)
     self.assertEqual(data, c.get_publisher())
示例#4
0
 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)