def test_offer_get_by_uuid(self): offer = api.offer_create(test_offer_1) api.offer_create(test_offer_2) res = api.offer_get_by_uuid(offer.uuid) self.assertEqual(offer.uuid, res.uuid) self.assertEqual(offer.project_id, res.project_id) self.assertEqual(offer.properties, res.properties)
def test_offer_update(self): o1 = api.offer_create(test_offer_3) values = { 'start_time': test_offer_2['start_time'], 'end_time': test_offer_2['end_time'] } api.offer_update(o1.uuid, values) o1 = api.offer_get_by_uuid(o1.uuid) self.assertEqual(test_offer_2['start_time'], o1.start_time) self.assertEqual(test_offer_2['end_time'], o1.end_time)
def test_offer_get_by_name_not_found(self): assert api.offer_get_by_uuid('some_uuid') is None
def test_offer_destroy_not_found(self): self.assertEqual(api.offer_get_by_uuid('offer_4'), None)
def test_offer_destroy(self): o1 = api.offer_create(test_offer_2) api.offer_destroy(o1.uuid) self.assertEqual(api.offer_get_by_uuid('offer_2'), None)