Skip to content

Commit d204f30

Browse files
committed
Add a test for the format of the server address
In this commit I'm adding a test which ensures that the Server address is a 2-tuple of (host, port), with the host being a string and the port being a positive integer. This format is expected by existing code.
1 parent 645d6f1 commit d204f30

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_smtp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ def test_smtpserver_funcarg(smtpserver):
3939
assert smtpserver.accepting and smtpserver.addr
4040

4141

42+
def test_smtpserver_addr(smtpserver):
43+
host, port = smtpserver.addr
44+
assert isinstance(host, str)
45+
assert isinstance(port, int)
46+
assert port > 0
47+
48+
4249
def test_server_is_killed(smtpserver):
4350
assert smtpserver.is_alive()
4451
smtpserver.stop()

0 commit comments

Comments
 (0)