def no_test_002_fake_tx(self): s = "abcd" x = tuple(self.make_waveform(s).tolist() ) src = gr.vector_source_c(x) dst = rf.fake_tx() dst.set_nchannels(1) dst.set_interp_rate(128) self.tb.connect (src, dst) self.tb.run() expected_data = self.tobytes(x) self.assertEqual(dst.outputQ().count(), 1) msg = dst.outputQ().delete_head() type, arg1, arg2 = 0, 1.0, 1.0e6 self.assertAlmostEqual(msg.type(), type) self.assertAlmostEqual(msg.arg1(), arg1) self.assertAlmostEqual(msg.arg1(), arg1) self.assertEqual (msg.to_string(), expected_data)
def no_test_003_fake_rx(self): s = "abcd" x = tuple(self.make_waveform(s).tolist() ) src = gr.vector_source_c(x) tx = rf.fake_tx() ntb = gr.top_block() ntb.connect(src, tx) ntb.run() rx = rf.fake_rx() dst = gr.vector_sink_c() msg = tx.outputQ().delete_head() rx.inputQ().insert_tail(msg) rx.shutdown() # schedules shutdown self.tb.connect(rx, dst) self.tb.run() result_data = dst.data () self.assertComplexTuplesAlmostEqual (x, result_data, len(x)+1 )