-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add CLI option * add get_nodes * move from option to argument * test cli
- Loading branch information
Showing
7 changed files
with
175 additions
and
3 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 zntrack.examples | ||
|
||
|
||
@pytest.mark.needs_internet | ||
def test_get_nodes_remote(proj_path): | ||
nodes = zntrack.get_nodes( | ||
remote="https://github.com/PythonFZ/ZnTrackExamples.git", rev="890c714" | ||
) | ||
|
||
assert nodes["HelloWorld"].random_number == 123 | ||
|
||
|
||
def test_get_nodes(proj_path): | ||
with zntrack.Project(automatic_node_names=True) as proj: | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
|
||
with proj.group("example1"): | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
|
||
with proj.group("nested", "GRP1"): | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
with proj.group("nested", "GRP2"): | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
_ = zntrack.examples.ParamsToOuts(params=15) | ||
|
||
proj.run() | ||
|
||
nodes = zntrack.get_nodes(remote=proj_path, rev=None) | ||
|
||
assert nodes["ParamsToOuts"].outs == 15 | ||
assert nodes["ParamsToOuts_1"].outs == 15 | ||
assert nodes["example1_ParamsToOuts"].outs == 15 | ||
assert nodes["example1_ParamsToOuts_1"].outs == 15 | ||
assert nodes["nested_GRP1_ParamsToOuts"].outs == 15 | ||
assert nodes["nested_GRP1_ParamsToOuts_1"].outs == 15 | ||
assert nodes["nested_GRP2_ParamsToOuts"].outs == 15 | ||
assert nodes["nested_GRP2_ParamsToOuts_1"].outs == 15 |
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