summaryrefslogtreecommitdiff
path: root/gr-blocks/python/blocks/qa_file_source.py
diff options
context:
space:
mode:
authormormj <mormjb@gmail.com>2020-10-30 10:59:50 -0400
committerMarcus Müller <marcus@hostalia.de>2020-10-30 17:52:53 +0100
commit7a0948ba85758fba1cc3858ef99bfa600dcc7416 (patch)
tree610d7f9d773a193562def6df2d4b50f1bb3b3f86 /gr-blocks/python/blocks/qa_file_source.py
parent12192ee7d58de95ddca35a3e93bfc172bdb5c820 (diff)
qa: run autopep8 formatting on qa python files
find ./ -iname qa*.py | xargs autopep8 --in-place -a -a mostly formats whitespace and gets rid of trailing semicolons
Diffstat (limited to 'gr-blocks/python/blocks/qa_file_source.py')
-rw-r--r--gr-blocks/python/blocks/qa_file_source.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/gr-blocks/python/blocks/qa_file_source.py b/gr-blocks/python/blocks/qa_file_source.py
index 9b282f3111..38de4f458e 100644
--- a/gr-blocks/python/blocks/qa_file_source.py
+++ b/gr-blocks/python/blocks/qa_file_source.py
@@ -14,6 +14,7 @@ import array
import pmt
from gnuradio import gr, gr_unittest, blocks
+
class test_file_source(gr_unittest.TestCase):
@classmethod
@@ -31,10 +32,10 @@ class test_file_source(gr_unittest.TestCase):
del cls._datafilename
del cls._datafile
- def setUp (self):
+ def setUp(self):
self.tb = gr.top_block()
- def tearDown (self):
+ def tearDown(self):
self.tb = None
def test_file_source(self):
@@ -60,7 +61,10 @@ class test_file_source(gr_unittest.TestCase):
def test_file_source_with_offset(self):
expected_result = self._vector[100:]
- src = blocks.file_source(gr.sizeof_float, self._datafilename, offset=100)
+ src = blocks.file_source(
+ gr.sizeof_float,
+ self._datafilename,
+ offset=100)
snk = blocks.vector_sink_f()
self.tb.connect(src, snk)
@@ -71,9 +75,13 @@ class test_file_source(gr_unittest.TestCase):
self.assertEqual(len(snk.tags()), 0)
def test_source_with_offset_and_len(self):
- expected_result = self._vector[100:100+600]
+ expected_result = self._vector[100:100 + 600]
- src = blocks.file_source(gr.sizeof_float, self._datafilename, offset=100, len=600)
+ src = blocks.file_source(
+ gr.sizeof_float,
+ self._datafilename,
+ offset=100,
+ len=600)
snk = blocks.vector_sink_f()
self.tb.connect(src, snk)
self.tb.run()
@@ -86,7 +94,7 @@ class test_file_source(gr_unittest.TestCase):
src = blocks.file_source(gr.sizeof_float, self._datafilename)
self.assertTrue(src.seek(0, os.SEEK_SET))
- self.assertTrue(src.seek(len(self._vector)-1, os.SEEK_SET))
+ self.assertTrue(src.seek(len(self._vector) - 1, os.SEEK_SET))
# Seek past end of file - this will also log a warning
self.assertFalse(src.seek(len(self._vector), os.SEEK_SET))
# Negative seek - this will also log a warning
@@ -102,7 +110,6 @@ class test_file_source(gr_unittest.TestCase):
# Seek past end of file - this will also log a warning
self.assertFalse(src.seek(len(self._vector), os.SEEK_CUR))
-
def test_begin_tag(self):
expected_result = self._vector
@@ -137,5 +144,6 @@ class test_file_source(gr_unittest.TestCase):
self.assertEqual(str(tags[1].value), "1")
self.assertEqual(tags[1].offset, 1000)
+
if __name__ == '__main__':
gr_unittest.run(test_file_source)