示例#1
0
def test_initial_pass(raw_list,expected):
    head = create_linked_list(raw_list)
    got = solution.initial_pass(head)
    expected = create_linked_list(expected)
    while got.next and expected.next:
        assert got.val == expected.val
        got = got.next
        expected = expected.next
示例#2
0
def test_initial_pass(given, low, high, expected):
    root = None
    for i, val in enumerate(given):
        if i == 0:
            root = build_tree(root, val=val)
        else:
            build_tree(root, val)

    got = solution.initial_pass(root, low, high)
    assert got == expected
示例#3
0
def test_initial_pass(list1, list2, expected):
    head1 = create_linked_list(list1)
    head2 = create_linked_list(list2)
    expected = create_linked_list(expected)

    got = solution.initial_pass(head1, head2)
    if expected:
        while expected:
            assert got.val == expected.val
            expected = expected.next
            got = got.next
示例#4
0
def test_initial_pass(raw_list, n, expected):
    head = create_linked_list(raw_list)
    got = solution.initial_pass(head, n)

    if expected:
        expected = create_linked_list(expected)
    if got and expected:
        while got.val and expected.val:
            assert got.val == expected.val
            got = got.next
            expected = expected.next
            if got is None:
                assert expected is None
                break
    else:
        assert got is None
示例#5
0
def test_initial_pass(numbers, target, expected):
    got = solution.initial_pass(numbers, target)
    assert got == expected
示例#6
0
def test_initial_pass(n, k, expected):
    got = solution.initial_pass(n, k)
    assert len(got) == len(expected)
示例#7
0
def test_initial_pass(nums, k, expected):
    solution.initial_pass(nums, k)
    assert nums == expected
示例#8
0
def test_initial_pass(nums, expected):
    got = solution.initial_pass(nums)
    assert len(got) == len(expected)
    for p in got:
        assert list(p) in expected
示例#9
0
def test_initial_pass(num_versions, bad_version):
    got = solution.initial_pass(num_versions, bad_version)
    assert got == bad_version
示例#10
0
def test_initial_pass(s, expected):
    got = solution.initial_pass(s)
    assert len(got) == len(expected)
    for ans in got:
        assert ans in expected
示例#11
0
def test_initial_pass(nums, expected_list, expected_k):
    got = solution.initial_pass(nums)
    assert got == expected_k
    for i in range(expected_k):
        assert nums[i] == expected_list[i]
示例#12
0
def test_initial_solution(image, starting_row_index, starting_column_index,
                          expected, new_color):
    got = solution.initial_pass(image, starting_row_index,
                                starting_column_index, new_color)
    assert got == expected
示例#13
0
def test_initial_pass(nums, val, expected):
    got = solution.initial_pass(nums, val)
    assert got == expected
    for i in range(expected):
        assert nums[i] != val
示例#14
0
def test_initial_pass(arr, start, expected):
    got = solution.initial_pass(arr, start)
    assert got is expected
示例#15
0
def test_initial_pass(grid, expected):
    got = solution.initial_pass(grid)
    assert got == expected
示例#16
0
def test_initial_pass(strs, expected):
    got = solution.initial_pass(strs)
    assert got == expected
示例#17
0
def test_initial_pass(s1, s2, expected):
    # breakpoint()
    got = solution.initial_pass(s1, s2)
    assert got is expected