Exemple #1
0
        auction_pet.last_updated = auction_pet.time_posted
        auction_mount.last_updated = auction_mount.time_posted

        sold_auction_item = SoldAuction(operation, False, *(auction_item, 1, 25, 0, 1, buyout, "LONG", 45, buyout, auction_item.time_posted, False))
        sold_auction_pet = SoldAuction(operation, False, *(auction_pet, 2, 82800, 39, 2, buyout*2, "MEDIUM", 45, buyout*2, auction_pet.time_posted, False))
        sold_auction_mount = SoldAuction(operation, False, *(auction_mount, 3, 34060, 0, 3, buyout*3, "SHORT", 45, buyout*3, auction_mount.time_posted, False))

        item_item = new_items[0]
        item_pet = new_items[1]
        item_mount = new_items[2]

        item_item.updateMean(sold_auction_item, operation)
        item_pet.updateMean(sold_auction_pet, operation)
        item_mount.updateMean(sold_auction_mount, operation)

        self.assertEqual(50, item_item.mean_price)
        self.assertEqual(50, item_pet.mean_price)
        self.assertEqual(50, item_mount.mean_price)



if __name__ == "__main__":
    logger = Logger(os.getcwd())
    db = Database(DATABASE, logger, test=True)
    operation = Operation(db, logger)
    operation.live_data = {"auctions":{}, "items":{}, "classes":{}, "subclasses":{}, "pets":{}, "mounts":{}}
    request = Request(CREDENTIALS, db, logger)
    realm = Realm(1096, db, logger, request)
    new_items, rebuild_items = ItemTest.init()
    unittest.main()