Example #1
0
 def test_zero_step(self):
     with self.assertRaises(ValueError):
         range_(10, 20, 0)
Example #2
0
 def test_no_arguments(self):
     with self.assertRaises(TypeError):
         range_()
Example #3
0
 def test_two_ascending_arguments_with_positive_step(self):
     self.assertEqual(range_(10, 20, 2), list(range(10, 20, 2)))
Example #4
0
 def test_two_descending_arguments_with_negative_step(self):
     self.assertEqual(range_(20, 10, -2), list(range(20, 10, -2)))
Example #5
0
 def test_two_descending_arguments(self):
     self.assertEqual(range_(20, 10), list(range(20, 10)))
Example #6
0
 def test_two_ascending_arguments(self):
     self.assertEqual(range_(10, 20), list(range(10, 20)))
Example #7
0
 def test_one_zero_argument(self):
     self.assertEqual(range_(0), list(range(0)))
Example #8
0
 def test_one_negative_argument(self):
     self.assertEqual(range_(-10), list(range(-10)))
Example #9
0
 def test_one_positive_argument(self):
     self.assertEqual(range_(10), list(range(10)))