Пример #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])
Пример #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, ''])
Пример #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), [])
Пример #4
0
 def test_empty(self):
     before, after = mi.before_and_after(bool, [])
     self.assertEqual(list(before), [])
     self.assertEqual(list(after), [])