Ejemplo n.º 1
0
    def test_update(self):
        updates = (
            ({'a':'a'}, {'a':'b'}),
            ({'a':'a'}, {'b':'a'}),
        )

        for dict_sequence in updates:
            i = injective_dict()
            try:
                for d in dict_sequence:
                    for k, v in d.items():
                        i[k] = v
                else:
                    raise AssertionError(f'test for {bad} should have failed')
            except injective_dict.NotInjectiveError:
                pass
Ejemplo n.º 2
0
 def setUp(self):
     self.test_funcs = (
         lambda d: injective_dict(d),
         lambda d: injective_dict(**d),
     )