Skip to content

Commit

Permalink
Fix issue with cartridge_icon parsing from xml (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
cutz authored and ryanhiebert committed Jun 20, 2018
1 parent 280d3ff commit 4b8fc3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lti/tool_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def process_xml(self, xml):
self.secure_icon = child.text
if 'cartridge_bundle' in child.tag:
self.cartridge_bundle = child.attrib['identifierref']
if 'catridge_icon' in child.tag:
self.cartridge_icon = child.atrib['identifierref']
if 'cartridge_icon' in child.tag:
self.cartridge_icon = child.attrib['identifierref']

if 'vendor' in child.tag:
# Parse vendor tag
Expand Down
7 changes: 7 additions & 0 deletions tests/test_tool_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ def test_optional_config_parameters(self):
got = normalize_xml(config.to_xml())
self.assertEqual(got, correct)

def test_can_parse_optional_config_parameters(self):
'''
Config should have cartridge_icon and blti:icon set
'''
config = ToolConfig.create_from_xml(CC_LTI_OPTIONAL_PARAMS_XML)
self.assertEqual(config.cartridge_icon, 'BLTI001_Icon')

def test_read_xml_config(self):
'''
Should read an XML config.
Expand Down

0 comments on commit 4b8fc3c

Please sign in to comment.