-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests for preprocess arg parsing
- Loading branch information
Showing
1 changed file
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,40 @@ | ||
from hexrd.preprocess.profiles import ( | ||
Eiger_Arguments, | ||
Dexelas_Arguments, | ||
HexrdScript_Arguments, | ||
) | ||
|
||
|
||
# test load/safe with defaults | ||
def test_save_load_defaults_eiger(): | ||
eargs = Eiger_Arguments() | ||
buffer = eargs.dump_config() | ||
args = HexrdScript_Arguments.load_from_config(buffer) | ||
assert eargs == args | ||
|
||
|
||
def test_save_load_defaults_dexelas(): | ||
eargs = Dexelas_Arguments() | ||
buffer = eargs.dump_config() | ||
args = HexrdScript_Arguments.load_from_config(buffer) | ||
assert eargs == args | ||
|
||
|
||
# test load/safe with modified parameters | ||
def test_save_load_eiger(): | ||
eargs = Eiger_Arguments() | ||
eargs.base_dir = "/data" | ||
eargs.num_frames = 1 | ||
buffer = eargs.dump_config() | ||
args = HexrdScript_Arguments.load_from_config(buffer) | ||
assert eargs == args | ||
|
||
|
||
def test_save_load_dexelas(): | ||
eargs = Dexelas_Arguments() | ||
eargs.base_dir = "/data" | ||
eargs.num_frames = 1 | ||
eargs.panel_opts["FF1"] = {("add-row", 1000)} | ||
buffer = eargs.dump_config() | ||
args = HexrdScript_Arguments.load_from_config(buffer) | ||
assert eargs == args |