mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-18 23:38:02 +00:00
Add assign cookies challenge
This commit is contained in:
24
online_judges/assign_cookies/test_assign_cookie.py
Normal file
24
online_judges/assign_cookies/test_assign_cookie.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from nose.tools import assert_equal, assert_raises
|
||||
|
||||
|
||||
class TestAssignCookie(object):
|
||||
|
||||
def test_assign_cookie(self):
|
||||
solution = Solution()
|
||||
assert_raises(TypeError, solution.find_content_children, None, None)
|
||||
assert_equal(solution.find_content_children([1, 2, 3],
|
||||
[1, 1]), 1)
|
||||
assert_equal(solution.find_content_children([1, 2],
|
||||
[1, 2, 3]), 2)
|
||||
assert_equal(solution.find_content_children([7, 8, 9, 10],
|
||||
[5, 6, 7, 8]), 2)
|
||||
print('Success: test_find_content_children')
|
||||
|
||||
|
||||
def main():
|
||||
test = TestAssignCookie()
|
||||
test.test_assign_cookie()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user