-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
graph: add simple test to check graph can be generated successfully
- Loading branch information
1 parent
bea13f7
commit d3c63c6
Showing
2 changed files
with
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
import tempfile | ||
import uuid | ||
from pathlib import Path | ||
from test_base import TestBase | ||
from warnet.utils import DEFAULT_TAG | ||
|
||
base = TestBase() | ||
base.network = False | ||
base.start_server() | ||
|
||
with tempfile.TemporaryDirectory() as dir: | ||
tf = f"{dir}/{str(uuid.uuid4())}.graphml" | ||
print(f"Writing test graph to {tf}") | ||
print(base.warcli(f"graph create n=10 --outfile={tf} --version={DEFAULT_TAG}", network=False)) | ||
base.wait_for_predicate(lambda: Path(tf).exists()) | ||
|
||
# Test that the graph actually works | ||
print(base.warcli(f"network start {Path(tf)}")) | ||
base.wait_for_all_tanks_status(target="running") | ||
base.warcli("rpc 0 getblockcount") | ||
|
||
base.stop_server() |