def setUp(self): self.semaphore_mocks = {} self.factory = SwitchFactory(switch_source=None, lock_factory=MockLockFactory( self.semaphore_mocks)) switch_factory.factories['test_model'] = _FakeSwitch
def test_get_info(self): get_distribution_mock = Mock() get_distribution_mock.return_value = Distribution( version="1.1.111.dev111111111") NetmanApi(SwitchFactory(None, ThreadingLockFactory()), get_distribution_callback=get_distribution_mock).hook_to( self.app) data, code = self.get("/netman/info") assert_that(data, matches_fixture("get_info.json"))