예제 #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
예제 #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
예제 #3
0
 def setUp(self):
     self.protocol = Device('COM3')
     self.transport = proto_helpers.StringTransport()
     self.protocol.makeConnection(self.transport)
예제 #4
0
 def setUp(self):
     self.protocol = Device('COM3')
     self.transport = proto_helpers.StringTransport()
     self.protocol.makeConnection(self.transport)