Пример #1
0
def test_failedCompleteUserCreation(username, password):
    with pytest.raises(SystemExit) as sysExit:
        alreadyExistsResult = enroll.userAlreadyExists(username)
        passwordResult = enroll.checkPassword(password)
        result = enroll.accepted(username, password)

        assert sysExit.type == SystemExit
        assert sysExit.value.code == -1
Пример #2
0
def test_numberPassword(password):
    # since on fail, sys.exit() is called
    with pytest.raises(SystemExit) as sysExit:
        result = enroll.checkPassword(password)

        # check for both exit type and exit code
        assert sysExit.type == SystemExit
        assert sysExit.value.code == -1
Пример #3
0
def test_goodPassword(password):
    result = enroll.checkPassword(password)
    assert result == True