Exemplo n.º 1
0
    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")
        possibly_bad_serialization = d._hashable_representation()
        self.assertIn("description=Test", possibly_bad_serialization, "Hashable representation of Device did not include description")

        g = FacilityGroup()
        possibly_worse_serialization = d._hashable_representation()
        self.assertIn("description=Test", possibly_worse_serialization, "Instantiating a FacilityGroup changed hashable representation of Device")
Exemplo n.º 2
0
    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")
        possibly_bad_serialization = d._hashable_representation()
        self.assertIn("description=Test", possibly_bad_serialization, "Hashable representation of Device did not include description")

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