-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for the icepack tool class
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pytest | ||
from .edalize_tool_common import tool_fixture | ||
|
||
|
||
def test_tool_icepack(tool_fixture): | ||
from .edalize_tool_common import FILES | ||
|
||
files = FILES.copy() | ||
files.append({"name": "asc_file.asc", "file_type": "iceboxAscii"}) | ||
|
||
tf = tool_fixture("icepack", files=files) | ||
|
||
tf.tool.configure() | ||
|
||
|
||
def test_tool_icepack_no_input(tool_fixture): | ||
with pytest.raises(RuntimeError) as e: | ||
tool = tool_fixture("icepack", files=[]) | ||
assert "No input file specified for icepack" in str(e.value) | ||
|
||
|
||
def test_tool_icepack_multiple_inputs(tool_fixture): | ||
from .edalize_tool_common import FILES | ||
|
||
files = FILES.copy() | ||
files.append({"name": "asc_file.asc", "file_type": "iceboxAscii"}) | ||
files.append({"name": "another_asc_file.asc", "file_type": "iceboxAscii"}) | ||
|
||
with pytest.raises(RuntimeError) as e: | ||
tf = tool_fixture("icepack", files=files) | ||
assert ( | ||
"Icepack only supports one input file. Found asc_file.asc and another_asc_file.asc" | ||
in str(e.value) | ||
) |
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,6 @@ | ||
#Auto generated by Edalize | ||
|
||
all: asc_file.bin | ||
|
||
asc_file.bin: asc_file.asc | ||
$(EDALIZE_LAUNCHER) icepack asc_file.asc asc_file.bin |