def test_array():

    expected_1 = [2, 4, 5, 6, 8]
    expected_2 = [4, 8, 15, 16, 23, 42]

    actual_1 = insertShiftArray([2, 4, 6, 8], 5)
    actual_2 = insertShiftArray([4, 8, 15, 23, 42], 16)

    assert actual_1 == expected_1
    assert actual_2 == expected_2
Beispiel #2
0
def test_odd():
    actual = insertShiftArray(b, 16)
    expected = [4, 8, 16, 15, 23, 42]
    assert actual == expected
Beispiel #3
0
def test_even():
    actual = insertShiftArray(a, 5)
    expected = [2, 4, 5, 6, 8]
    assert actual == expected
def test_insertShiftArray_one():

    actual = insertShiftArray([2, 4, 6, 8], 5)
    expected = [2, 4, 5, 6, 8]
    assert actual == expected, 'value should be added to the middle of the list'
def test_insertShiftArray_two():

    actual = insertShiftArray([4, 8, 15, 23, 42], 16)
    expected = [4, 8, 15, 16, 23, 42]
    assert actual == expected, 'value should be added to the middle of the list'
Beispiel #6
0
def test_shift_odd():
    actual = insertShiftArray([1, 2, 3], 5)
    expect = [1, 5, 2, 3]
    assert actual == expect
Beispiel #7
0
def test_shift_even():
    actual = insertShiftArray(["value one", "value two"], "insert")
    expect = ["value one", "insert", "value two"]
    assert actual == expect
Beispiel #8
0
def test_check_numbers_one():
    actual = insertShiftArray([1, 2, 3, 4, 5, 6], 8)
    expected = [1, 2, 3, 8, 4, 5, 6]
    assert actual == expected
Beispiel #9
0
def test_check_string_two():
    actual = insertShiftArray(["Biden", "Harris", "Obama", "AOC", "Porter"],
                              "Ilhan")
    expected = ["Biden", "Harris", "Obama", "Ilhan", "AOC", "Porter"]
    assert actual == expected
Beispiel #10
0
def test_check_string_one():
    actual = insertShiftArray(["Huckabee", "Conway", "McConnel", "Trump"],
                              "Melania")
    expected = ["Huckabee", "Conway", "Melania", "McConnel", "Trump"]
    assert actual == expected
Beispiel #11
0
def test_check_numbers_two():
    actual = insertShiftArray([1, 2, 3, 4, 5, 6, 7, 8, 9], 100)
    expected = [1, 2, 3, 4, 5, 100, 6, 7, 8, 9]
    assert actual == expected