2020-07-15 09:34:08 +08:00
|
|
|
import unittest
|
2017-03-29 16:36:40 +08:00
|
|
|
|
|
|
|
|
2020-07-15 09:34:08 +08:00
|
|
|
class TestAssignCookie(unittest.TestCase):
|
2017-03-29 16:36:40 +08:00
|
|
|
|
|
|
|
def test_assign_cookie(self):
|
|
|
|
solution = Solution()
|
2020-07-15 09:34:08 +08:00
|
|
|
self.assertRaises(TypeError, solution.find_content_children, None, None)
|
|
|
|
self.assertEqual(solution.find_content_children([1, 2, 3],
|
2017-03-29 16:36:40 +08:00
|
|
|
[1, 1]), 1)
|
2020-07-15 09:34:08 +08:00
|
|
|
self.assertEqual(solution.find_content_children([1, 2],
|
2017-03-29 16:36:40 +08:00
|
|
|
[1, 2, 3]), 2)
|
2020-07-15 09:34:08 +08:00
|
|
|
self.assertEqual(solution.find_content_children([7, 8, 9, 10],
|
2017-03-29 16:36:40 +08:00
|
|
|
[5, 6, 7, 8]), 2)
|
|
|
|
print('Success: test_find_content_children')
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
test = TestAssignCookie()
|
|
|
|
test.test_assign_cookie()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2020-07-15 09:34:08 +08:00
|
|
|
main()
|