Skip to content

Commit 871f3bc

Browse files
Kyle A LogueTeque5
authored andcommitted
fix test failures where temporary dataset suffix was incorrect
1 parent f8be2af commit 871f3bc

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

sigmf/sigmffile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,8 @@ def get_dataset_filename_from_metadata(meta_fn, metadata=None):
938938
Parse provided metadata and return the expected data filename. In the case of
939939
a metadata only distribution, or if the file does not exist, this will return
940940
'None'. The priority for conflicting:
941-
1. The file named <METAFILE_BASENAME>.sigmf-data if it exists
942-
2. The file in the `core:dataset` field (Non-Compliant Dataset) if it exists
941+
1. The file named <stem>.SIGMF_DATASET_EXT if it exists
942+
2. The file in the DATASET_KEY field (Non-Compliant Dataset) if it exists
943943
3. None (may be a metadata only distribution)
944944
"""
945945
compliant_filename = get_sigmf_filenames(meta_fn)["data_fn"]

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
import pytest
1212

1313
from sigmf import __specification__
14+
from sigmf.archive import SIGMF_DATASET_EXT
1415
from sigmf.sigmffile import SigMFFile
1516

1617
from .testdata import TEST_FLOAT32_DATA, TEST_METADATA
1718

1819

1920
@pytest.fixture
2021
def test_data_file():
21-
"""when called, yields temporary file"""
22-
with tempfile.NamedTemporaryFile() as temp:
22+
"""when called, yields temporary dataset"""
23+
with tempfile.NamedTemporaryFile(suffix=f".{SIGMF_DATASET_EXT}") as temp:
2324
TEST_FLOAT32_DATA.tofile(temp.name)
2425
yield temp
2526

0 commit comments

Comments
 (0)