Esempio n. 1
0
 def setUp(self):
     self.d = AliasedDict(
         {
             ("hello", "hello world", 17) : 170,
             ("goodbye", "goodbye world", 75, 31) : "the end",
             frozenset({"failure", "is not", "success"}) : 3.14,
             8 : 88,
             frozenset((9, 10)): [1, 2, 3],
             170 : 17
         }
     )
Esempio n. 2
0
 def test_construct_error_4(self):
     with self.assertRaises(KeyError):
         AliasedDict({ ("a", frozenset(("b", "c"))) : 3})
Esempio n. 3
0
 def test_construct_error_2(self):
     with self.assertRaises(KeyError):
         AliasedDict({ ("a", "b") : 3, ("b", "c") : 4})
Esempio n. 4
0
 def test_construct_error_1(self):
     with self.assertRaises(KeyError):
         AliasedDict({ ("a", "b") : 3, "a" : 5})