def test_house_parse_status_without_bids(self): """Testing parsing the status of a house with no bids""" house = House("Name") content = self._load_resource(FILE_HOUSE_STATUS_NO_BIDS) house._parse_status(content) self.assertEqual(house.status, HouseStatus.AUCTIONED) self.assertIsNone(house.auction_end)
def test_house_parse_status_rented(self): """Testing parsing a rented status""" house = House("Name") content = self._load_resource(FILE_HOUSE_STATUS_RENTED) house._parse_status(content) self.assertEqual(house.status, HouseStatus.RENTED) self.assertEqual(house.owner, "Thorcen") self.assertIsInstance(house.paid_until, datetime.datetime)
def test_house_parse_status_with_bids(self): """Testing parsing a house status with bids""" house = House("Name") content = self._load_resource(FILE_HOUSE_STATUS_WITH_BIDS) house._parse_status(content) self.assertEqual(house.status, HouseStatus.AUCTIONED) self.assertIsNone(house.owner) self.assertEqual(house.highest_bid, 15000) self.assertEqual(house.highest_bidder, "King of Bosnia") self.assertIsInstance(house.auction_end, datetime.datetime)
def test_house_from_content_transferred(self): """Testing parsing a house being transferred""" house = House("Name") content = self._load_resource(FILE_HOUSE_STATUS_TRANSFER) house._parse_status(content) self.assertEqual(house.status, HouseStatus.RENTED) self.assertEqual(house.owner, "Xenaris mag") self.assertEqual(house.transferee, "Ivarr Bezkosci") self.assertIsNotNone(house.transferee_url) self.assertTrue(house.transfer_accepted) self.assertEqual(house.transfer_price, 850000)