예제 #1
0
 def setUp(self, mock_txtx, mock_rxrx):
     global mock_tx
     global mock_rx
     global tport
     mock_rx = mock_rxrx
     mock_tx = mock_txtx
     tport = transport.Transport(True, None, None, None)
예제 #2
0
    def test_should_init_rxsensitivity(self, mock_tx, mock_rx):
        quiet_init = None
        wav_prefix = None
        framerate = None
        rxsens = 0.04

        t = transport.Transport(quiet_init, wav_prefix, framerate, rxsens)

        sert(mock_rx).called_once_with(2, 1, 44100, False, None, 0.04)
        sert(mock_tx).called_once_with(2, 1, 44100, False, None)
예제 #3
0
    def test_should_init_wav_file(self, mock_tx, mock_rx):
        quiet_init = None
        wav_prefix = 'pfx'
        framerate = None
        rxsens = None

        t = transport.Transport(quiet_init, wav_prefix, framerate, rxsens)

        sert(mock_rx).called_once_with(2, 1, 44100, False, 'pfx_rx.wav', 0.11)
        sert(mock_tx).called_once_with(2, 1, 44100, False, 'pfx_tx.wav')
예제 #4
0
    def test_should_init_framerate(self, mock_tx, mock_rx):
        quiet_init = None
        wav_prefix = None
        framerate = 22050
        rxsens = None

        t = transport.Transport(quiet_init, wav_prefix, framerate, rxsens)

        sert(mock_rx).called_once_with(2, 1, 22050, False, None, 0.11)
        sert(mock_tx).called_once_with(2, 1, 22050, False, None)
예제 #5
0
    def test_should_init_quietly(self, mock_tx, mock_rx):
        quiet_init = True
        wav_prefix = None
        framerate = None
        rxsens = None

        t = transport.Transport(quiet_init, wav_prefix, framerate, rxsens)

        sert(mock_rx).called_once_with(2, 1, 44100, True, None, 0.11)
        sert(mock_tx).called_once_with(2, 1, 44100, True, None)