def test_get_schema(self): """ Test we get a Steamodd Schema object """ schema = Schema.get_schema() self.assertIsInstance(schema, steam.items.schema) self.assertGreaterEqual( len(schema), 5033 ) # 5033 at time of test writing. This will fail if the WebAPI is down.
def fetch_images(itemdef=None): # FIXME: Disabled while Dota 2's item schema WebAPI doesn't work, else every /league page load is horribly slow. return None, None try: item_data = Schema.get_by_id(itemdef) return item_data.icon, item_data.image except KeyError: return None, None
def test_get_by_id(self): drodo = Schema.get_by_id(self.DRODO['defindex']) self.assertIsInstance(drodo, steam.items.item) self.assertEqual(drodo.schema_id, self.DRODO['defindex']) self.assertEqual(drodo.name, self.DRODO['name'])
def test_get_schema(self): """ Test we get a Steamodd Schema object """ schema = Schema.get_schema() self.assertIsInstance(schema, steam.items.schema) self.assertGreaterEqual(len(schema), 5033) # 5033 at time of test writing. This will fail if the WebAPI is down.
def fetch_images(itemdef=None): try: item_data = Schema.get_by_id(itemdef) return item_data.icon, item_data.image except KeyError: return None, None