Skip to content

Commit 6eab918

Browse files
author
macgyver13
committed
Resolve ruff formatting issues
1 parent bfbca03 commit 6eab918

File tree

2 files changed

+39
-25
lines changed

2 files changed

+39
-25
lines changed

test/graph_test.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python3
22

33
import json
4-
import os, time
4+
import os
5+
import time
56

67
import pexpect
78
from test_base import TestBase
@@ -39,25 +40,25 @@ def directory_exists(self):
3940
self.sut = pexpect.spawn("warnet create")
4041
self.sut.expect("name", timeout=10)
4142
self.sut.sendline("ANewNetwork")
42-
time.sleep(.1)
43+
time.sleep(0.1)
4344
self.sut.expect("many", timeout=10)
4445
self.sut.sendline("")
45-
time.sleep(.1)
46+
time.sleep(0.1)
4647
self.sut.expect("connections", timeout=10)
4748
self.sut.sendline("")
48-
time.sleep(.1)
49+
time.sleep(0.1)
4950
self.sut.expect("version", timeout=10)
5051
self.sut.sendline("")
51-
time.sleep(.1)
52+
time.sleep(0.1)
5253
self.sut.expect("enable fork-observer", timeout=10)
5354
self.sut.sendline("")
54-
time.sleep(.1)
55+
time.sleep(0.1)
5556
self.sut.expect("seconds", timeout=10)
5657
self.sut.sendline("")
57-
time.sleep(.1)
58+
time.sleep(0.1)
5859
self.sut.expect("enable grafana", timeout=10)
5960
self.sut.sendline("")
60-
time.sleep(.1)
61+
time.sleep(0.1)
6162
self.sut.expect("successfully", timeout=50)
6263
except Exception as e:
6364
print(f"\nReceived prompt text:\n {self.sut.before.decode('utf-8')}\n")

test/local_test_runner.py

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import subprocess
2+
import sys
3+
14
import yaml
2-
import subprocess, sys
35

46
# developers can use this tool to verify all repo workflow test execute to completion
57
#
@@ -19,38 +21,49 @@ def has_key_path(d, key_path, separator="."):
1921
d = d[key]
2022
return True
2123

24+
2225
# Load the workflow file
23-
with open('.github/workflows/test.yml', 'r') as file:
26+
with open(".github/workflows/test.yml") as file:
2427
workflow = yaml.safe_load(file)
2528

26-
tests_total=0
27-
tests_skipped=0
28-
tests_completed=0
29+
tests_total = 0
30+
tests_skipped = 0
31+
tests_completed = 0
2932

30-
for job_name, job_details in workflow.get("jobs", {}).items():
33+
for job_details in workflow.get("jobs", {}).values():
3134
if has_key_path(job_details, "strategy.matrix.test"):
3235
print("Found test strategy job, starting serial execution of each test")
3336
tests = job_details["strategy"]["matrix"]["test"]
34-
37+
3538
for test in tests:
36-
tests_total+=1
39+
tests_total += 1
3740
if len(sys.argv) > 1 and sys.argv[1] not in test:
38-
print("skipping test as requested:",test)
39-
tests_skipped+=1
41+
print("skipping test as requested:", test)
42+
tests_skipped += 1
4043
continue
4144
command = f"python test/{test}"
42-
print("###################################################################################################")
45+
print(
46+
"###################################################################################################"
47+
)
4348
print("############## executing:", command)
44-
print("###################################################################################################")
49+
print(
50+
"###################################################################################################"
51+
)
4552
process = subprocess.run(command, shell=True)
4653
if process.returncode != 0:
4754
print("******** testing failed")
48-
if process.stdout: print("stdout:", process.stdout)
49-
if process.stderr: print("stderr:", process.stderr)
55+
if process.stdout:
56+
print("stdout:", process.stdout)
57+
if process.stderr:
58+
print("stderr:", process.stderr)
5059
sys.exit(1)
51-
tests_completed+=1
60+
tests_completed += 1
5261

53-
print("###################################################################################################")
62+
print(
63+
"###################################################################################################"
64+
)
5465
print("testing complete")
5566
print(f"{tests_completed} of {tests_total} complete - skipped: {tests_skipped} tests")
56-
print("###################################################################################################")
67+
print(
68+
"###################################################################################################"
69+
)

0 commit comments

Comments
 (0)