-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_client.py
More file actions
54 lines (40 loc) · 1.4 KB
/
test_client.py
File metadata and controls
54 lines (40 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import unittest
from unittest import TestCase
import server
from client import client, Client
class test_client(TestCase):
"""
for this set up i require to run the server (to get the ip of the server)!
notice : The "import" opens a new client
"""
def setUp(self) -> None:
PORT = 50011
self.client = Client(PORT)
# self.client2 = Client(PORT) #for nickname test2
""" test: if the client haveing the corret port """
def test_port(self):
print("-------Test port----------")
self.assertEqual(self.client.port, 50011)
print("PASSED!")
""" for this test i manually enter the name yossi """
def test_nickame(self):
print("-------Test nickname----------")
self.assertEqual(self.client.nickname, "yossi")
print("PASSED!")
# for i in server.server_files:
# print(i)
# self.assertEqual(self.client.nickname, )
print("test2")
# self.assertEqual(self.client2.nickname, "gal")
# print("PASSED!")
"""
For this test you need to replace it with the server's IP address
"""
# def test_host(self):
# print("-------Test host----------")
# self.assertEqual(self.client.host, "192.168.1.31")
# print("PASSED!")
# def test_list(self):
# for i in server.server_files:
# print(i)
# self.assertEqual(1, 1)