Skip to content

Commit 19222e7

Browse files
authored
feat: Update type icons to include logo (ref: sprites/pull/199) (#1443)
* feat: Update type icons to include logo (ref: sprites/pull/199) * feat: Update field to symbol_icon
1 parent 387e79f commit 19222e7

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

data/v2/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,10 @@ def csv_record_to_objects(info):
660660
sprites[generation][game] = {
661661
"name_icon": file_path_or_none(
662662
f"types/{generation}/{game}/{info[0]}.png"
663-
)
663+
),
664+
"symbol_icon": file_path_or_none(
665+
f"types/{generation}/{game}/small/{info[0]}.png"
666+
),
664667
}
665668

666669
yield TypeSprites(type_id=int(info[0]), sprites=sprites)

data/v2/sprites

Submodule sprites updated 8491 files

pokemon_v2/tests.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ def setup_type_sprites_data(cls, type):
731731
sprites[generation][game] = None
732732
else:
733733
sprites[generation][game] = {
734-
"name_icon": f"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/types/{generation}/{game}/{type.id}.png"
734+
"name_icon": f"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/types/{generation}/{game}/{type.id}.png",
735+
"symbol_icon": f"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/types/{generation}/{game}/small/{type.id}.png",
735736
}
736737

737738
type_sprites = TypeSprites.objects.create(
@@ -3659,6 +3660,12 @@ def test_type_api(self):
36593660
json.loads(response.data["sprites"])[generation][game]["name_icon"],
36603661
sprites_data[generation][game]["name_icon"],
36613662
)
3663+
self.assertEqual(
3664+
json.loads(response.data["sprites"])[generation][game][
3665+
"symbol_icon"
3666+
],
3667+
sprites_data[generation][game]["symbol_icon"],
3668+
)
36623669

36633670
# Pokedex Tests
36643671
def test_pokedex_api(self):

0 commit comments

Comments
 (0)