Пример #1
0
    def test_extraction_filenotfound_error():
        file_path = Path(TEST_DATA_DIR, 'testfile2.srec')

        with TemporaryDirectory() as tmp_dir:
            meta_data = unpack_function(file_path, tmp_dir)

        assert 'Failed to open file' in meta_data['output']
Пример #2
0
    def test_extraction_bad_file():
        file_path = Path(get_test_data_dir(), 'test_data_file.bin')

        with TemporaryDirectory() as tmp_dir:
            meta_data = unpack_function(file_path, tmp_dir)

        assert 'not starting with an \'S\'' in meta_data['output']
Пример #3
0
    def test_extraction_decoding_error():
        for srec_file in ['bad_testfile.srec', 'bad_testfile2.srec']:
            file_path = Path(TEST_DATA_DIR, srec_file)

            with TemporaryDirectory() as tmp_dir:
                meta_data = unpack_function(file_path, tmp_dir)

            assert 'Unknown' in meta_data['output']