def test_item_init_from_dict(self):
        item = Item({
            'id': '123456',
            'name': '+1 Steel Longsword of Meteor Strike'
        })

        self.assertEqual(item.get_name(),
                         '+1 Steel Longsword of Meteor Strike')
Esempio n. 2
0
pc_response.set_discount_percent(15)

print '[test] update_event_promocode'
response = constantcontact.update_event_promocode(event_response, pc_response)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
    raw_input('press enter for next test')

print '[test] delete_event_promocode'
response = constantcontact.delete_event_promocode(event_response, pc_response)
if printout and response:
    print response
    raw_input('press enter for next test')

item = Item()
item.set_default_quantity_total(10)
item.set_name('Cauldrons')
item.set_per_registrant_limit(1)
item.set_price(4)

print '[test] post_event_items'
response = constantcontact.post_event_items(event_response, item)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
    raw_input('press enter for next test')

print '[test] get_event_items'
response = constantcontact.get_event_items(event_response)
if printout and response:
    print json.dumps(response, indent = 4, sort_keys = True)
Esempio n. 3
0
    def test_item_init_from_dict(self):
        item = Item({'id': '123456', 'name': '+1 Steel Longsword of Meteor Strike'})

        self.assertEqual(item.get_name(), '+1 Steel Longsword of Meteor Strike')
    def test_item_fees(self):
        item = Item()

        self.assertEqual(item.get_attributes(), None)

        attribute1 = Attribute()
        attribute1.set_id('4321')
        attribute1.set_name('')
        attribute2 = Attribute()
        attribute2.set_id('1234')
        attribute2.set_name('')

        item.set_attributes([attribute1, attribute2])

        self.assertEqual(len(item.get_attributes()), 2)

        item.delete_attribute_by_id('1234')

        self.assertEqual(len(item.get_attributes()), 1)

        item.set_attributes([attribute1, attribute2])
        item.delete_attribute(0)

        self.assertEqual(item.get_attributes()[0].get_id(), '1234')

        item.clear_attributes()

        self.assertEqual(item.get_attributes(), None)
Esempio n. 5
0
    def test_item_fees(self):
        item = Item()

        self.assertEqual(item.get_attributes(), None)

        attribute1 = Attribute()
        attribute1.set_id('4321')
        attribute1.set_name('')
        attribute2 = Attribute()
        attribute2.set_id('1234')
        attribute2.set_name('')

        item.set_attributes([attribute1, attribute2])

        self.assertEqual(len(item.get_attributes()), 2)

        item.delete_attribute_by_id('1234')

        self.assertEqual(len(item.get_attributes()), 1)

        item.set_attributes([attribute1, attribute2])
        item.delete_attribute(0)

        self.assertEqual(item.get_attributes()[0].get_id(), '1234')

        item.clear_attributes()

        self.assertEqual(item.get_attributes(), None)