Beispiel #1
0
def test_user():
    x = model_User.User(123456, "Vasiliy", "*****@*****.**", 1234, 5678,
                        9101112, 7889)
    name = x.name
    email = x.email
    user_id = x.id
    used_book_id = x.used_books_id

    assert name == "Vasiliy"
    assert email == "*****@*****.**"
    assert user_id == 123456
    assert used_book_id == [1234, 5678, 9101112, 7889]
Beispiel #2
0
def test_passes_user_book_id_long():
    with pytest.raises(Exception):
        model_User.User(123456, "Vasiliy", "*****@*****.**", 1234567891,
                        5678, 9101112, 7889)
Beispiel #3
0
def test_passes_email_long():
    with pytest.raises(Exception):
        model_User.User(
            123456, "Vasiliy",
            "*****@*****.**",
            1234, 5678, 9101112, 7889)
Beispiel #4
0
def test_passes_name_long():
    with pytest.raises(Exception):
        model_User.User(123456, "Vasiliygrtdefrt", "*****@*****.**", 1234,
                        5678, 9101112, 7889)
Beispiel #5
0
def test_passes_email_short():
    with pytest.raises(Exception):
        model_User.User(123456, "Vasiliy", "par", 1234, 5678, 9101112, 7889)
Beispiel #6
0
def test_passes_name_short():
    with pytest.raises(Exception):
        model_User.User(123456, "Vas", "*****@*****.**", 1234, 5678,
                        9101112, 7889)
Beispiel #7
0
def test_passes_user_book_id():
    with pytest.raises(Exception):
        model_User.User(123456, "dsds", "*****@*****.**", " ")
Beispiel #8
0
def test_passes_email():
    with pytest.raises(Exception):
        model_User.User(123456, "dsds", " ", 1234, 5678, 9101112, 7889)
Beispiel #9
0
def test_passes_id():
    with pytest.raises(Exception):
        model_User.User(" ", "dsds", "*****@*****.**", 1234, 5678, 9101112,
                        7889)