def test_store_is_called_with_correct_args(self): self.store.create(self.name) store = MagicMock() store.set = MagicMock() flag = FeatureFlag(self.name, store) flag.disable() store.set.assert_called_once_with(self.name, False)
def test_store_is_called_with_correct_args(self): store = MagicMock() store.delete = MagicMock() flag = FeatureFlag(self.name, store) self.store.create(self.name) flag.destroy() store.delete.assert_called_once_with(self.name)
def test_client_is_called_with_correct_args(self): client = MagicMock() flag = FeatureFlag(self.name, client) flag.disable() client.disable.assert_called_once_with(self.name)
def setUp(self): self.name = self.txt() self.store = MemoryFeatureFlagStore() self.client = FeatureFlagClient(self.store) self.flag = FeatureFlag(self.name, self.client)