def test_dict_params(self): change = ConsumeOfferChange(1, [], params={"url": "url", "application-name": "application_name"}) self.assertEqual({"change_id": 1, "requires": [], "url": "url", "application_name": "application_name"}, change.__dict__)
async def test_run(self, event_loop): change = ConsumeOfferChange(1, [], params={"url": "url", "application-name": "application_name"}) model = mock.Mock() model.consume = base.AsyncMock(return_value=None) context = mock.Mock() context.resolve = mock.Mock(side_effect=['application1']) context.model = model result = await change.run(context) assert result is None model.consume.assert_called_once() model.consume.assert_called_with("url", application_alias="application1")
def test_method(self): self.assertEqual("consumeOffer", ConsumeOfferChange.method())