示例#1
0
    def setUp(self):
        # Setup dual port - pointing at each other
        self.testAddressA = ('127.0.0.1', 10000)

        self.testBytes = b'Hello, World!'

        # A should discover listen address from itself
        self.commA = commObj( broadcastAddress=self.testAddressA )
        self.commA.openPort()

        # B should discover boradcast address from A
        self.commB = commObj( listenAddress=self.testAddressA )
        self.commB.openPort()

        return super().setUp()
示例#2
0
    def setUp(self):
        # Setup dual port - pointing at each other
        self.testAddressA = os.path.abspath('') + '/.testA'
        self.testAddressB = os.path.abspath('') + '/.testB'

        self.testBytes = b'Hello, World!'

        # B should discover boradcast address from A
        self.commB = commObj( listenAddress=self.testAddressA, broadcastAddress=self.testAddressB )
        self.commB.set_AF_type( socket.AF_UNIX )
        self.commB.openPort()

        # A should discover listen address from itself
        self.commA = commObj( broadcastAddress=self.testAddressA, listenAddress=self.testAddressB )
        self.commA.set_AF_type( socket.AF_UNIX )
        self.commA.openPort()

        return super().setUp()
示例#3
0
    def setUp(self):
        # Setup reflective port - written data appears on read port
        self.testAddressA = ('localhost', 10000)

        self.testAddressB = self.testAddressA

        self.comm = commObj( self.testAddressA, self.testAddressB )

        self.testBytes = b'Hello, World!'

        return super().setUp()
示例#4
0
 def test_notConnected(self):
     # Connected should not occur before port is opened
     comm = commObj( self.testAddressA )
     
     self.assertEqual( comm.isOpen(), False )
示例#5
0
 def test_objectedExsists(self):
     comm = commObj( self.testAddressA )
     self.assertIsInstance(comm, commObj)