Example #1
0
 def test_some_true(self):
     before, after = mi.before_and_after(bool, [1, True, 0, False])
     self.assertEqual(list(before), [1, True])
     self.assertEqual(list(after), [0, False])
Example #2
0
 def test_never_true(self):
     before, after = mi.before_and_after(bool, [0, False, None, ''])
     self.assertEqual(list(before), [])
     self.assertEqual(list(after), [0, False, None, ''])
Example #3
0
 def test_never_false(self):
     before, after = mi.before_and_after(bool, [1, True, Ellipsis, ' '])
     self.assertEqual(list(before), [1, True, Ellipsis, ' '])
     self.assertEqual(list(after), [])
Example #4
0
 def test_empty(self):
     before, after = mi.before_and_after(bool, [])
     self.assertEqual(list(before), [])
     self.assertEqual(list(after), [])