<commit_before>__author__ = '<NAME>'
'''created @2015/9/14''' 
import unittest
import os
import sys
pardir =os.path.dirname(os.path.realpath(os.getcwd()))
#pardir= os.path.sep.join(pardir.split(os.path.sep)[:-1])
sys.path.append(os.path.sep.join([pardir,'lib']))



class Test_winTerm(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        from winTelnet import winTelnet
        name= 'e7-20'
        cmd = 'telnet 192.168.1.113'
        #cmd = 'telnet cdc-dash'
        #cmd = 'telnet 10.245.48.20'#great wall e7-20
        #cmd = 'telnet 10.245.69.106'#ryi
        attr={'TIMEOUT':180,'LOGIN': 'e7support,assword:,30\nadmin,>,30','CMD':cmd, 'LINEEND':'\r\n', 'EXP':'name:' }
        logger=None
        global  logpath
        logpath='./tmp1'

        import shutil
        global logpaht
        if os.path.exists(logpath):
            shutil.rmtree(logpath)


        if not os.path.exists(logpath):
            os.mkdir('tmp1')
        cls.logpath = logpath
        cls.baseS = winTelnet(name,attr,logpath)
        global  baseS
        baseS = cls.baseS



    def setUp(self):
        pass
    def test_Login(self):
        baseS.Find('ogin:', 30)
        baseS.Send('syu')
        baseS.Find('assword', 30)
        baseS.Send('yxw123')
        baseS.Find('~', 30)
        baseS.Send('ping localhost')
        import time
        c = 30
        while c:
            print(baseS.Print())
            c-=1
            time.sleep(0.1)
        baseS.Find('.*')

        baseS.Send('c',Ctrl=True)

        assert baseS.Find('abc', 0.01)


    @classmethod
    def tearDownClass(cls):
        baseS.__del__()
        del cls.baseS






if __name__ == '__main__':
    unittest.main()<commit_msg>validate Send/Find/Print<commit_after>__author__ = '<NAME>'
'''created @2015/9/14''' 
import unittest
import os
import sys
pardir =os.path.dirname(os.path.realpath(os.getcwd()))
#pardir= os.path.sep.join(pardir.split(os.path.sep)[:-1])
sys.path.append(os.path.sep.join([pardir,'lib']))



class Test_winTerm(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        from winTelnet import winTelnet
        name= 'e7-20'
        cmd = 'telnet 192.168.1.113'
        #cmd = 'telnet cdc-dash'
        #cmd = 'telnet 10.245.48.20'#great wall e7-20
        #cmd = 'telnet 10.245.69.106'#ryi
        attr={'TIMEOUT':180,'LOGIN': 'e7support,assword:,30\nadmin,>,30','CMD':cmd, 'LINEEND':'\r\n', 'EXP':'name:' }
        logger=None
        global  logpath
        logpath='./tmp1'

        import shutil
        global logpaht
        if os.path.exists(logpath):
            shutil.rmtree(logpath)


        if not os.path.exists(logpath):
            os.mkdir('tmp1')
        cls.logpath = logpath
        cls.baseS = winTelnet(name,attr,logpath)
        global  baseS
        baseS = cls.baseS



    def setUp(self):
        pass
    def test_Login(self):
        baseS.Find('ogin:', 30)
        baseS.Send('syu')
        baseS.Find('assword', 30)
        baseS.Send('yxw123')
        baseS.Find('~', 30)
        baseS.Send('ping localhost')
        import time
        c = 30
        while c:
            print(baseS.Print())
            c-=1
            time.sleep(0.1)
        baseS.Find('.*')

        baseS.Send('c',Ctrl=True)

        self.assertRaises(Exception, baseS.Find, 'abc', 0.01)
        print 'done'


    @classmethod
    def tearDownClass(cls):
        baseS.__del__()
        del cls.baseS






if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.15254237288135594, 'fraction_numerical': 0.04021832806664752, 'mean_word_length': 2.097864768683274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4186742', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1225, 'n_words': 215}