import sys
from types import FunctionType, MethodType, BuiltinFunctionType
import pyclbr
-from unittest import TestCase
+from unittest import TestCase, main as unittest_main
StaticMethodType = type(staticmethod(lambda: None))
ClassMethodType = type(classmethod(lambda c: None))
if __name__ == "__main__":
- unittest.main()
+ unittest_main()
import time
import contextlib
-from unittest import TestCase
from test import support
+import unittest
threading = support.import_module('threading')
HOST = support.HOST
finally:
serv.close()
-class GeneralTests(TestCase):
+class GeneralTests(unittest.TestCase):
def setUp(self):
self.evt = threading.Event()
telnet._messages = '' # debuglevel output
return telnet
-class ExpectAndReadTestCase(TestCase):
+class ExpectAndReadTestCase(unittest.TestCase):
def setUp(self):
self.old_selector = telnetlib._TelnetSelector
telnetlib._TelnetSelector = MockSelector
tl = telnetlib
-class WriteTests(TestCase):
+class WriteTests(unittest.TestCase):
'''The only thing that write does is replace each tl.IAC for
tl.IAC+tl.IAC'''
written = b''.join(telnet.sock.writes)
self.assertEqual(data.replace(tl.IAC,tl.IAC+tl.IAC), written)
-class OptionTests(TestCase):
+class OptionTests(unittest.TestCase):
# RFC 854 commands
cmds = [tl.AO, tl.AYT, tl.BRK, tl.EC, tl.EL, tl.GA, tl.IP, tl.NOP]