Esempio n. 1
0
 def test_add_multiples_of_slave_connection(self):
     self.assertIsNotNone(self.mock_master.slave_connections)
     self.mock_master.add_slave_connection(SlaveConnection(None))
     slavc = SlaveConnection(None)
     slavc.full_address = "192.168.100.1"
     self.mock_master.add_slave_connection(slavc)
     self.assertGreaterEqual(len(self.mock_master.slave_connections.keys()), 2)
Esempio n. 2
0
 def test_request_next_calls_multiple_slave_connections_show_next(self):
     self.assertIsNotNone(self.mock_master.slave_connections)
     slavc = SlaveConnection(None)
     slavc.show_next = MagicMock(return_value=0)
     self.mock_master.add_slave_connection(slavc)
     slavc = SlaveConnection(None)
     slavc.full_address = "192.168.100.1"
     slavc.show_next = MagicMock(return_value=0)
     self.mock_master.add_slave_connection(slavc)
     self.mock_master.request_next()
     for slaveconnection in self.mock_master.slave_connections.values():
         slaveconnection.show_next.assert_called_once_with()