Skip to content

Commit

Permalink
PB-227: Add language to icon-set metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasJoss committed Sep 11, 2024
1 parent b755c02 commit 257aa96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/icon_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@ def serialize(self):
"colorable": self.colorable,
"icons_url": self.get_icons_url(),
"template_url": get_icon_set_template_url(get_base_url()),
"has_description": bool(find_descripton_file(self.name))
"has_description": bool(find_descripton_file(self.name)),
"language": self.name.split('-')[-1] if '-' in self.name else None
}
3 changes: 3 additions & 0 deletions tests/unit_tests/test_all_icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def test_all_icon_sets_endpoint(self):
self.assertTrue(icon_set['name'] in self.all_icon_sets)
self.assertIn('colorable', icon_set)
self.assertIn('icons_url', icon_set)
self.assertIn('has_description', icon_set)
self.assertIn('language', icon_set)

def test_all_icon_sets_metadata_endpoint(self):
"""
Expand All @@ -192,6 +194,7 @@ def test_all_icon_sets_metadata_endpoint(self):
self.assertEqual(icon_set_name, icon_set_metadata['name'])
self.assertIn('colorable', icon_set_metadata)
self.assertIn('has_description', icon_set_metadata)
self.assertIn('language', icon_set_metadata)
self.assertIn('icons_url', icon_set_metadata)
self.assertIsNotNone(icon_set_metadata['icons_url'])
self.assertEqual(
Expand Down

0 comments on commit 257aa96

Please sign in to comment.