Exemplo n.º 1
0
 def test_filter(self):
     self.assertEquals(
         self.FILTERED_TRUTHY_DICT,
         __unit__.filterkeys(FilterKeys.FILTER, self.TRUTHY_DICT))
     self.assertEquals(
         self.FILTERED_FALSY_DICT,
         __unit__.filterkeys(FilterKeys.FILTER, self.FALSY_DICT))
Exemplo n.º 2
0
 def test_filter(self):
     self.assertEquals(
         self.FILTERED_TRUTHY_DICT,
         __unit__.filterkeys(FilterKeys.FILTER, self.TRUTHY_DICT))
     self.assertEquals(
         self.FILTERED_FALSY_DICT,
         __unit__.filterkeys(FilterKeys.FILTER, self.FALSY_DICT))
Exemplo n.º 3
0
 def test_dict__empty(self):
     self.assertEquals({}, __unit__.filterkeys(None, {}))
     self.assertEquals({}, __unit__.filterkeys(self.FILTER, {}))
Exemplo n.º 4
0
 def test_dict__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.filterkeys(FilterKeys.FILTER, object())
Exemplo n.º 5
0
 def test_dict__none(self):
     with self.assertRaises(TypeError):
         __unit__.filterkeys(FilterKeys.FILTER, None)
Exemplo n.º 6
0
 def test_function__non_function(self):
     with self.assertRaises(TypeError):
         __unit__.filterkeys(object(), self.TRUTHY_DICT)
Exemplo n.º 7
0
 def test_function__none(self):
     self.assertEquals(self.TRUTHY_DICT,
                       __unit__.filterkeys(None, self.TRUTHY_DICT))
     self.assertEquals(self.COALESCED_FALSY_DICT,
                       __unit__.filterkeys(None, self.FALSY_DICT))
Exemplo n.º 8
0
 def test_dict__empty(self):
     self.assertEquals({}, __unit__.filterkeys(None, {}))
     self.assertEquals({}, __unit__.filterkeys(self.FILTER, {}))
Exemplo n.º 9
0
 def test_dict__some_object(self):
     with self.assertRaises(TypeError):
         __unit__.filterkeys(FilterKeys.FILTER, object())
Exemplo n.º 10
0
 def test_dict__none(self):
     with self.assertRaises(TypeError):
         __unit__.filterkeys(FilterKeys.FILTER, None)
Exemplo n.º 11
0
 def test_function__non_function(self):
     with self.assertRaises(TypeError):
         __unit__.filterkeys(object(), self.TRUTHY_DICT)
Exemplo n.º 12
0
 def test_function__none(self):
     self.assertEquals(self.TRUTHY_DICT,
                       __unit__.filterkeys(None, self.TRUTHY_DICT))
     self.assertEquals(self.COALESCED_FALSY_DICT,
                       __unit__.filterkeys(None, self.FALSY_DICT))