mirror of
https://github.com/TheGreyDiamond/Enlight.git
synced 2025-12-19 08:20:45 +01:00
Added unti testing!
This commit is contained in:
@@ -1,10 +1,31 @@
|
||||
from src import session
|
||||
import sys
|
||||
sys.path.append('mainCode/../')
|
||||
import mainCode.session
|
||||
import unittest
|
||||
import time
|
||||
|
||||
|
||||
class NamesTestCase(unittest.TestCase):
|
||||
class SessionTesting(unittest.TestCase):
|
||||
|
||||
def test_first_last_name(self):
|
||||
testSession = session.enlightSession("TestSession", role = session.HOST)
|
||||
testSession.initConnection()
|
||||
self.assertEqual(testSession.getSessionMembers(), [])
|
||||
def setUp(self):
|
||||
self.testSession = mainCode.session.enlightSession("TestSession", role = mainCode.session.HOST)
|
||||
self.testSession.initConnection()
|
||||
|
||||
def test_check_if_members_are_empty(self):
|
||||
time.sleep(1)
|
||||
members = self.testSession.getSessionMembers()
|
||||
self.assertEqual(members, [])
|
||||
|
||||
def test_if_allow_join_is_okay(self):
|
||||
time.sleep(2)
|
||||
self.assertEqual(self.testSession.allowJoin, True)
|
||||
|
||||
def test_if_var_and_func_return_same(self):
|
||||
time.sleep(3)
|
||||
self.assertEqual(self.testSession.sessionId, self.testSession.getSessionId())
|
||||
|
||||
def tearDown(self):
|
||||
self.testSession.stopSession()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user