-
Notifications
You must be signed in to change notification settings - Fork 1
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
5 changed files
with
61 additions
and
60 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
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,43 @@ | ||
from easyreflectometry import Project | ||
from easyreflectometry.utils import count_fixed_parameters | ||
from easyreflectometry.utils import count_free_parameters | ||
from easyreflectometry.utils import count_parameter_user_constraints | ||
|
||
|
||
def test_count_free_parameters(): | ||
# When | ||
project = Project() | ||
project.default_model() | ||
project.parameters[0].free = True | ||
|
||
# Then | ||
count = count_free_parameters(project) | ||
|
||
# Expect | ||
assert count == 1 | ||
|
||
|
||
def test_count_fixed_parameters(): | ||
# When | ||
project = Project() | ||
project.default_model() | ||
project.parameters[0].free = True | ||
|
||
# Then | ||
count = count_fixed_parameters(project) | ||
|
||
# Expect | ||
assert count == 13 | ||
|
||
|
||
def test_count_parameter_user_constraints(): | ||
# When | ||
project = Project() | ||
project.default_model() | ||
project.parameters[0].user_constraints['name_other_parameter'] = 'constraint' | ||
|
||
# Then | ||
count = count_parameter_user_constraints(project) | ||
|
||
# Expect | ||
assert count == 1 |