Exemple #1
0
def test_password_invalid_no_duplicate():
    a = 1
    b = 2
    c = 3
    d = 4
    e = 8
    f = 9
    object = Password(a, b, c, d, e, f)
    assert not object.is_part1_valid()
    assert not object.is_part2_valid()
Exemple #2
0
def test_password_invalid_bad_order():
    a = 1
    b = 2
    c = 2
    d = 4
    e = 8
    f = 4
    object = Password(a, b, c, d, e, f)
    assert not object.is_part1_valid()
    assert not object.is_part2_valid()
Exemple #3
0
def test_password_invalid_final_zero():
    a = 1
    b = 2
    c = 2
    d = 4
    e = 8
    f = 0
    object = Password(a, b, c, d, e, f)
    assert not object.is_part1_valid()
    assert not object.is_part2_valid()
Exemple #4
0
def test_password_only_part1_valid():
    a = 1
    b = 2
    c = 4
    d = 4
    e = 4
    f = 7
    object = Password(a, b, c, d, e, f)
    assert object.is_part1_valid()
    assert not object.is_part2_valid()
Exemple #5
0
def test_password_get():
    a = 1
    b = 2
    c = 2
    d = 3
    e = 4
    f = 4
    result = 122344
    object = Password(a, b, c, d, e, f)
    assert object.get() == result
Exemple #6
0
def test_password_variables():
    a = 1
    b = 2
    c = 3
    d = 4
    e = 5
    f = 6
    result = 123456
    object = Password(a, b, c, d, e, f)
    assert isinstance(object, Password)
    assert object.a == a
    assert object.b == b
    assert object.c == c
    assert object.d == d
    assert object.e == e
    assert object.f == f
    assert object.number == result
Exemple #7
0
def test_password_create():
    object = Password(1, 2, 3, 4, 5, 6)
    assert isinstance(object, Password)
Exemple #8
0
def test_password_part2_true_matches():
    test1 = Password(1, 1, 2, 3, 4, 5)
    test2 = Password(1, 2, 2, 3, 4, 5)
    test3 = Password(1, 2, 3, 3, 4, 5)
    test4 = Password(1, 2, 3, 4, 4, 5)
    test5 = Password(1, 2, 3, 4, 5, 5)
    assert test1.is_part2_valid()
    assert test2.is_part2_valid()
    assert test3.is_part2_valid()
    assert test4.is_part2_valid()
    assert test5.is_part2_valid()