示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    def test_offer_get_by_name_not_found(self):

        assert api.offer_get_by_uuid('some_uuid') is None
示例#4
0
 def test_offer_destroy_not_found(self):
     self.assertEqual(api.offer_get_by_uuid('offer_4'), None)
示例#5
0
 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)