Example #1
0
def test_output():
    assert list(count_by(1, 5)) == [1, 2, 3, 4, 5]
    assert list(count_by(2, 5)) == [2, 4, 6, 8, 10]
    assert list(count_by(3, 5)) == [3, 6, 9, 12, 15]
    assert list(count_by(50, 5)) == [50, 100, 150, 200, 250]
    assert list(count_by(100, 5)) == [100, 200, 300, 400, 500]
    assert list(count_by(1, 1)) == [1]
    assert list(count_by(1, 10)) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Example #2
0
def test_list():
    assert str(type(count_by(1,10)))[1:-1] == "type 'list'"
Example #3
0
 def test_rand(self):
     from random import randint
     for _ in range(50):
         x, n = randint(1, 100), randint(1, 20)
         expected = list(range(x, x * n + 1, x))
         self.assertEqual(count_by(x, n), expected)
Example #4
0
 def test(self):
     self.assertEqual(count_by(1, 5), [1, 2, 3, 4, 5])
     self.assertEqual(count_by(2, 5), [2, 4, 6, 8, 10])
     self.assertEqual(count_by(3, 5), [3, 6, 9, 12, 15])
     self.assertEqual(count_by(50, 5), [50, 100, 150, 200, 250])
     self.assertEqual(count_by(100, 5), [100, 200, 300, 400, 500])
Example #5
0
def test_count_by():
    assert count_by(1, 5) == [1, 2, 3, 4, 5]
    assert count_by(2, 5) == [2, 4, 6, 8, 10]
    assert count_by(3, 5) == [3, 6, 9, 12, 15]
    assert count_by(50, 5) == [50, 100, 150, 200, 250]
    assert count_by(100, 5) == [100, 200, 300, 400, 500]