Skip to content

Commit

Permalink
Issue #78 - made tests pass on python3
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoxia committed Feb 5, 2019
1 parent 52c6abf commit cd69e9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oblib/tests/test_data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def test_conversion_to_json(self):
root = json.loads(jsonstring)

# should have 2 facts:
all_facts = root["facts"].values()
all_facts = list(root["facts"].values())
self.assertEqual( len(all_facts), 2)

# each should have expected 'value' and 'aspects':
Expand Down Expand Up @@ -799,14 +799,14 @@ def test_decimals_and_precision(self):

# TODO is supposed to be in aspects or not?
self.assertEqual(len(facts), 1)
self.assertEqual(facts.values()[0]["aspects"]["precision"], "3")
self.assertEqual(list(facts.values())[0]["aspects"]["precision"], "3")

doc.set("solar:ModuleNameplateCapacity", "6.25", unit_name="W",
ProductIdentifierAxis = 1, decimals = 3)
jsonstring = doc.to_JSON_string()
facts = json.loads(jsonstring)["facts"]
self.assertEqual(len(facts), 1)
self.assertEqual(facts.values()[0]["aspects"]["decimals"], "3")
self.assertEqual(list(facts.values())[0]["aspects"]["decimals"], "3")

# Trying to set both decimals and precision should raise an error
with self.assertRaises(OBException):
Expand Down

0 comments on commit cd69e9f

Please sign in to comment.