mirror of
https://github.com/jopohl/urh.git
synced 2026-03-10 18:26:48 +01:00
refactor tests
This commit is contained in:
@@ -32,14 +32,6 @@ class TestHackRF(unittest.TestCase):
|
||||
|
||||
return 0
|
||||
|
||||
def test_set_rx(self):
|
||||
hackrf.setup()
|
||||
hackrf.set_freq(433.92e6)
|
||||
print(hackrf.is_streaming())
|
||||
hackrf.start_rx_mode(self.callback_fun)
|
||||
time.sleep(1)
|
||||
hackrf.stop_rx_mode()
|
||||
|
||||
def test_fromstring(self):
|
||||
buffer = b'\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xff\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfe\xfd\xfe\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfe'
|
||||
r = np.empty(len(buffer) // 2, dtype=np.float32)
|
||||
@@ -116,3 +108,7 @@ class TestHackRF(unittest.TestCase):
|
||||
|
||||
packed = HackRF.pack_complex(unpacked)
|
||||
self.assertEqual(received, packed)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user