|
|
@ -1,15 +1,14 @@ |
|
|
|
""" |
|
|
|
tests the server functionality |
|
|
|
""" |
|
|
|
import pytest |
|
|
|
|
|
|
|
|
|
|
|
def test_ping(server): |
|
|
|
assert server.ping(server, "some message") == "PONG" |
|
|
|
|
|
|
|
def test_command_pass(server): |
|
|
|
server.password = "password" |
|
|
|
assert server.command_pass(server, "password") == True |
|
|
|
|
|
|
|
def test_command_pass_wrong(server): |
|
|
|
@pytest.mark.parametrize("test_input,expected", [("password", True), ("wrong password", False)]) |
|
|
|
def test_command_pass(server, test_input, expected): |
|
|
|
server.password = "password" |
|
|
|
assert server.command_pass(server, "wrong password") == False |
|
|
|
assert server.command_pass(server, test_input) == expected |