-
Notifications
You must be signed in to change notification settings - Fork 22
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
Showing
3 changed files
with
47 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
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,42 @@ | ||
import pytest | ||
import modelx as mx | ||
|
||
|
||
|
||
@pytest.fixture | ||
def sample_no_params(): | ||
m = mx.new_model() | ||
m.new_space("Sample") | ||
yield m | ||
m._impl._check_sanity() | ||
m.close() | ||
|
||
|
||
@pytest.fixture | ||
def sample_with_params(sample_no_params): | ||
|
||
s = sample_no_params.Sample | ||
assert s.parameters is None | ||
s.parameters = ('x', 'y', 'Z') | ||
return sample_no_params | ||
|
||
|
||
def test_parameters_setter(sample_no_params): | ||
|
||
s = sample_no_params.Sample | ||
assert s.parameters is None | ||
s.parameters = ('x', 'y', 'Z') | ||
assert s.parameters == ('x', 'y', 'Z') | ||
|
||
|
||
def test_parameters_deleter(sample_with_params): | ||
|
||
s = sample_with_params.Sample | ||
assert s.parameters == ('x', 'y', 'Z') | ||
del s.parameters | ||
assert s.parameters is None | ||
|
||
|
||
|
||
|
||
|