Browse Source

[refactor] parametrized commnand_passwd function

master
Wayne 5 years ago
parent
commit
b0a7588135
  1. 9
      test/test_server.py

9
test/test_server.py

@ -1,15 +1,14 @@
""" """
tests the server functionality tests the server functionality
""" """
import pytest
def test_ping(server): def test_ping(server):
assert server.ping(server, "some message") == "PONG" 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" server.password = "password"
assert server.command_pass(server, "wrong password") == False
assert server.command_pass(server, test_input) == expected
Loading…
Cancel
Save