Skip to content

Commit

Permalink
Update test for #2470 to properly catch error even on Travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalex committed Apr 9, 2015
1 parent ade2bc3 commit 715b6ec
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python-packages/securesync/tests/crypto_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,14 @@ def test_facility_group_save(self):
class TestHashableFieldsAndSerialization(unittest.TestCase):

def test_description_exclusion_regression_bug_2470(self):
"""FacilityGroup.__init__ used to append "description" to _unhashable_fields, which affected other classes as well.
This test ensures that the description is not being excluded from Device._hashable_representation, even after
instantiating a FacilityGroup."""

d = Device(name="Test", description="Test")

good_serialization = d._hashable_representation()

g = FacilityGroup()

possibly_bad_serialization = d._hashable_representation()
self.assertIn("description=Test", possibly_bad_serialization, "Hashable representation of Device did not include description")

self.assertEqual(good_serialization, possibly_bad_serialization, "Instatiating a FacilityGroup changed hashable representation of Device")
g = FacilityGroup()
possibly_worse_serialization = d._hashable_representation()
self.assertIn("description=Test", possibly_worse_serialization, "Instantiating a FacilityGroup changed hashable representation of Device")

0 comments on commit 715b6ec

Please sign in to comment.