Ejemplo n.º 1
0
 def test_blocktool_exceptions(self):
     """
     tests for blocktool exceptions
     """
     # test for non-existent header or invalid headers
     test_dict = {}
     test_dict['file_path'] = os.path.abspath(
         os.path.join(self.test_dir, 'sample.h'))
     with self.assertRaises(BlockToolException):
         BlockHeaderParser(**test_dict).run_blocktool()
     # test for invalid header file
     test_dict['file_path'] = os.path.abspath(
         os.path.join(self.test_dir, 'CMakeLists.txt'))
     if not os.path.basename(test_dict['file_path']).endswith('.h'):
         with self.assertRaises(BlockToolException):
             BlockHeaderParser(**test_dict).run_blocktool()
Ejemplo n.º 2
0
 def setUpClass(cls):
     """ create a temporary Blocktool object """
     try:
         warnings.simplefilter("ignore", ResourceWarning)
     except NameError:
         pass
     test_path = {}
     target_file = os.path.abspath(os.path.join(os.path.dirname(
         __file__), '../../../../gr-analog/include/gnuradio/analog', 'agc2_cc.h'))
     test_path['file_path'] = target_file
     cls.test_obj = BlockHeaderParser(**test_path).get_header_info()