Esempio n. 1
0
class EpsonDeviceTestCase(unittest.TestCase):
    def setUp(self):
        self.protocol = Device('COM3')
        self.transport = proto_helpers.StringTransport()
        self.protocol.makeConnection(self.transport)

    def test_simple_command(self):
        d = self.protocol.sendLine('test')
        self.assertEqual('test\r', self.transport.value())
        self.transport.clear()

        d.addCallback(self.assertEqual, 'result')
        self.protocol.dataReceived('result\r')
        self.protocol.dataReceived(':')

        return d
Esempio n. 2
0
class EpsonDeviceTestCase(unittest.TestCase):
    
    def setUp(self):
        self.protocol = Device('COM3')
        self.transport = proto_helpers.StringTransport()
        self.protocol.makeConnection(self.transport)
    
    def test_simple_command(self):
        d = self.protocol.sendLine('test')
        self.assertEqual('test\r', self.transport.value())
        self.transport.clear()
        
        d.addCallback(self.assertEqual, 'result')
        self.protocol.dataReceived('result\r')
        self.protocol.dataReceived(':')
        
        return d
Esempio n. 3
0
 def setUp(self):
     self.protocol = Device('COM3')
     self.transport = proto_helpers.StringTransport()
     self.protocol.makeConnection(self.transport)
Esempio n. 4
0
 def setUp(self):
     self.protocol = Device('COM3')
     self.transport = proto_helpers.StringTransport()
     self.protocol.makeConnection(self.transport)