def test_can_chain_select(self): view = PropertyDictView({"A": 1, "B": 2, "C": 3}).B.C self.assertEqual(repr(view), "{B: 2, C: 3}")
def test_can_create_double_property_view(self): view = PropertyDictView({"A": 1, "B": 2}) self.assertEqual(repr(view), "{A: 1, B: 2}")
def test_can_select_non_existing_in_view(self): view = PropertyDictView({"A": 1, "B": 2}).C self.assertEqual(repr(view), "{}")
def test_can_create_single_property_view(self): view = PropertyDictView({"A": 1}) self.assertEqual(repr(view), "{A: 1}")
def test_can_create_empty_view(self): view = PropertyDictView({}) self.assertEqual(repr(view), "{}")
def test_non_containment(self): view = PropertyDictView({"A": 1, "B": 2, "C": 3}) self.assertNotIn("D", view)
def test_iterable(self): view = PropertyDictView({"A": 1, "B": 2, "C": 3}) self.assertEqual(set(view), {"A", "B", "C"})
def test_length(self): view = PropertyDictView({"A": 1, "B": 2, "C": 3}) self.assertEqual(len(view), 3)