def test_send(self, time): self._subject._extra_info = { 'some': 'thing' } self._subject._send(test_mode=True) assert_that( self._subject._send_sock.mock_calls, equal_to([ call.sendto( '{"uuid": "own_uuid", "priority": 2}', ('239.137.62.91', 6291) ) ]) ) assert_that( time.mock_calls, equal_to([ call.sleep(1) ]) )
def test_send_udp(): sock = Mock() method = get_method('pf') method.send_udp(sock, None, "127.0.0.1", "22222") assert sock.mock_calls == [call.sendto("22222", "127.0.0.1")]
def test_send_udp(): sock = Mock() method = get_method("nat") method.send_udp(sock, None, "127.0.0.1", "22222") assert sock.mock_calls == [call.sendto("22222", "127.0.0.1")]