Example #1
0
 def test_find_it(self):
     test_patterns = [
         ([20, 1, -1, 2, -2, 3, 3, 5, 5, 1, 2, 4, 20, 4, -1, -2, 5], 5),
         ([1, 1, 2, -2, 5, 2, 4, 4, -1, -2, 5], -1),
         ([20, 1, 1, 2, 2, 3, 3, 5, 5, 4, 20, 4, 5], 5),
         ([10], 10),
         ([1, 1, 1, 1, 1, 1, 10, 1, 1, 1, 1], 10),
         ([5, 4, 3, 2, 1, 5, 4, 3, 2, 10, 10], 1),
     ]
     for a, expected in test_patterns:
         with self.subTest(a=a, expected=expected):
             self.assertEqual(find_it(seq=a), expected)
Example #2
0
def test_find_it(a_collection, result):
    """
    test find_it function
    """
    from find_the_odd_int import find_it
    assert find_it(a_collection) == result
def test_find_the_odd_int(array, odd_int):
    """Test for find_it function."""
    from find_the_odd_int import find_it
    assert find_it(array) == odd_int
Example #4
0
 def test_find_it(self):
     self.assertEqual(find_it([-1, -2, 3, 3, 7, 10]), [-1, -2, 7, 10])
     self.assertEqual(find_it([1, 2, 2, 3]), [1, 3])
     self.assertEqual(find_it([1, 1, 2, 3, 3, 4, 5, 5, 99]), [2, 4, 99])
     self.assertEqual(find_it([10]), [10])
 def test_1(self):
     assert find_it([1,1,2,-2,5,2,4,4,-1,-2,5]) == -1
def test_find_it(n, result):
	"""Test for find_it function."""
	from find_the_odd_int import find_it
	assert find_it(n) == result
 def test_0(self):
     assert find_it([20,1,-1,2,-2,3,3,5,5,1,2,4,20,4,-1,-2,5]) == 5
 def test_5(self):
     assert find_it([5,4,3,2,1,5,4,3,2,10,10]) == 1
 def test_4(self):
     assert find_it([1,1,1,1,1,1,10,1,1,1,1]) == 10
 def test_3(self):
     assert find_it([10]) == 10
 def test_2(self):
     assert find_it([20,1,1,2,2,3,3,5,5,4,20,4,5]) == 5