mirror of
https://github.com/jlengrand/Coding4Interviews.git
synced 2026-03-10 08:11:24 +00:00
24 lines
431 B
Python
24 lines
431 B
Python
"""
|
|
Unit tests for the binary search algorithm
|
|
@jlengrand
|
|
2013/07
|
|
"""
|
|
from bin_search import bin_search
|
|
|
|
import unittest
|
|
|
|
|
|
class test_bin_search(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
self.arr1 = [1, 2, 3, 4, 5]
|
|
self.s1 = 3
|
|
self.res1 = None
|
|
|
|
def test_shuffle(self):
|
|
res = bin_search(self.arr1, self.s1)
|
|
self.assertEqual(res, self.res1)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|