def setUp(self): self.tb = gr.top_block() self.emitter = pdu_utils.message_emitter(pmt.PMT_NIL) self.time = pdu_utils.time_delta("TIME CHECKER") self.ctr = pdu_utils.message_counter(pmt.intern("counter")) self.tb.msg_connect((self.emitter, 'msg'), (self.time, 'pdu_in')) self.tb.msg_connect((self.emitter, 'msg'), (self.ctr, 'msg'))
def test_003_get_name(self): ''' tests get_name function ''' print('test_003_get_name() - name is ', self.ctr.get_name()) self.assertEqual('counter', self.ctr.get_name()) self.ctr = pdu_utils.message_counter("BoBo") self.assertEqual('BoBo', self.ctr.get_name())
def test_001_5x_pass (self): strobe = blocks.message_strobe(pmt.PMT_NIL, 25) ctr = pdu_utils.message_counter(pmt.intern("counter")) self.tb.msg_connect((strobe, 'strobe'), (ctr, 'msg')) self.tb.start() time.sleep(.135) self.tb.stop() self.tb.wait() self.assertEquals(5, ctr.get_ctr())
def setUp(self): self.tb = gr.top_block() self.emitter = pdu_utils.message_emitter() self.ctr = pdu_utils.message_counter("counter") self.tb.msg_connect((self.emitter, 'msg'), (self.ctr, 'msg'))
def setUp(self): self.tb = gr.top_block() self.strobe = blocks.message_strobe(pmt.PMT_NIL, 25) self.ctr = pdu_utils.message_counter(pmt.intern("counter")) self.tb.msg_connect((self.strobe, 'strobe'), (self.ctr, 'msg'))