示例#1
0
class TestVistaConnection(unittest.TestCase):
    def setUp(self):
        self.host = '74.67.137.153'
        self.port = 19200
        self.cxn = VistaConnection(self.host, self.port)

    def test_connect_disconnect(self):
        self.cxn.connect()
        self.assertTrue(self.cxn.is_connected)
        self.cxn.disconnect()
        self.assertFalse(self.cxn.is_connected)
class TestVistaConnection(unittest.TestCase):

    def setUp(self):
        self.host = '74.67.137.153'
        self.port = 19200
        self.cxn = VistaConnection(self.host, self.port)

    def test_connect_disconnect(self):
        self.cxn.connect()
        self.assertTrue(self.cxn.is_connected)
        self.cxn.disconnect()
        self.assertFalse(self.cxn.is_connected)
示例#3
0
class VistaSelectRuns(unittest.TestCase):
    def setUp(self):
        self.host = "74.67.137.153"
        self.port = 19200
        self.cxn = VistaConnection(self.host, self.port)
        self.user = VistaUser()

    def test_fms_run(self):
        query = VistaSelect()
        query.file = "410"
        query.fields = ".01;1;24;23;22"
        query.number = 200
        query.frum = "178"
        query.part = "178"
        query.index = "AN"

        self.cxn.connect()
        greeting = self.user.login(self.cxn, "1programmer", "programmer1.", "DVBA CAPRI GUI")
        rs = query.find(self.cxn)
        self.cxn.disconnect()

        self.assertEqual(56, len(rs))
示例#4
0
class TestVistaUser(unittest.TestCase):
    def setUp(self):
        self.host = '74.67.137.153'
        self.port = 19200
        self.cxn = VistaConnection(self.host, self.port)

    def test_login(self):
        self.cxn.connect()
        self.assertTrue(self.cxn.is_connected)

        user = VistaUser()
        access_code = '1programmer'
        verify_code = 'programmer1.'
        context = 'OR CPRS GUI CHART'
        greeting = user.login(self.cxn, access_code, verify_code, context)
        self.cxn.disconnect()

        self.assertEqual(access_code, user.access_code)
        self.assertEqual(verify_code, user.verify_code)
        self.assertEqual(context, user.context)
        self.assertEqual('1', user.duz)
        self.assertTrue(greeting.find('ZZPROGRAMMER'))
示例#5
0
class TestVistaUser(unittest.TestCase):
    def setUp(self):
        self.host = "74.67.137.153"
        self.port = 19200
        self.cxn = VistaConnection(self.host, self.port)

    def test_login(self):
        self.cxn.connect()
        self.assertTrue(self.cxn.is_connected)

        user = VistaUser()
        access_code = "1programmer"
        verify_code = "programmer1."
        context = "OR CPRS GUI CHART"
        greeting = user.login(self.cxn, access_code, verify_code, context)
        self.cxn.disconnect()

        self.assertEqual(access_code, user.access_code)
        self.assertEqual(verify_code, user.verify_code)
        self.assertEqual(context, user.context)
        self.assertEqual("1", user.duz)
        self.assertTrue(greeting.find("ZZPROGRAMMER"))
示例#6
0
class VistaSelectRuns(unittest.TestCase):
    def setUp(self):
        self.host = '74.67.137.153'
        self.port = 19200
        self.cxn = VistaConnection(self.host, self.port)
        self.user = VistaUser()

    def test_fms_run(self):
        query = VistaSelect()
        query.file = '410'
        query.fields = '.01;1;24;23;22'
        query.number = 200
        query.frum = '178'
        query.part = '178'
        query.index = 'AN'

        self.cxn.connect()
        greeting = self.user.login(self.cxn, '1programmer', 'programmer1.',
                                   'DVBA CAPRI GUI')
        rs = query.find(self.cxn)
        self.cxn.disconnect()

        self.assertEqual(56, len(rs))
示例#7
0
 def setUp(self):
     self.host = "74.67.137.153"
     self.port = 19200
     self.cxn = VistaConnection(self.host, self.port)
     self.user = VistaUser()
 def setUp(self):
     self.host = '74.67.137.153'
     self.port = 19200
     self.cxn = VistaConnection(self.host, self.port)
示例#9
0
 def setUp(self):
     self.host = '74.67.137.153'
     self.port = 19200
     self.cxn = VistaConnection(self.host, self.port)
     self.user = VistaUser()