예제 #1
0
 def test_filter_recursive_and_flat(self):
     fancy_dict = FancyDict(key=FancyDict(filter_key=1, another_key=0))
     assert {
         "filter_key": 1
     } == fancy_dict.filter(lambda k, v: k is "filter_key",
                            recursive=True,
                            flat=True)
예제 #2
0
 def test_filter_by_value(self):
     fancy_dict = FancyDict(filter_key=1, another_key=0)
     assert {"filter_key": 1} == fancy_dict.filter(lambda k, v: v is 1)