-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dbb10e
commit 557343b
Showing
2 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Tests for Rayleigh Frequency Shift format. | ||
""" | ||
|
||
import pytest | ||
|
||
import dascore as dc | ||
|
||
|
||
class TestWrite: | ||
"""Tests for writing to the NeubrexRFS format.""" | ||
|
||
@pytest.fixture(scope="class") | ||
def written_rfs(self, random_patch, tmp_path_factory): | ||
"""Write the random patch, return path.""" | ||
path = tmp_path_factory.mktemp("rfs") / "random_rfs.h5" | ||
random_patch.io.write(path, "NeubrexRFS") | ||
return path | ||
|
||
def test_multi_patch_raises(self, random_spool, tmp_path): | ||
"""Trying to save multiple patch should raise.""" | ||
msg = "only supports writing a single patch" | ||
with pytest.raises(ValueError, match=msg): | ||
dc.write(random_spool, tmp_path / "bad_file.h5", "NeubrexRFS") | ||
|
||
def test_format(self, written_rfs): | ||
"""Ensure the returned format type is correct.""" | ||
format_name = dc.get_format(written_rfs) | ||
assert "NeubrexRFS" in format_name |