Skip to content

Commit

Permalink
change tests to allow quiet run
Browse files Browse the repository at this point in the history
  • Loading branch information
jblance authored Oct 10, 2023
1 parent 6fc9886 commit c3708f7
Show file tree
Hide file tree
Showing 42 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
format:
flake8 setup.py mppsolar tests

mppsolar-tests:
python3 -m unittest discover -s tests/mppsolar -f -v
python3 -m unittest discover -s tests/mppsolar_tests -f -v

powermon-unit-tests:
python3 -m unittest discover -s tests/powermon/unit -f -v
python3 -m unittest discover -s tests/powermon_tests/unit -f -v

powermon-integration-tests:
python3 -m unittest discover -s tests/powermon/integration -f -v
python3 -m unittest discover -s tests/powermon_tests/integration -f -v

test:
python3 -m unittest discover -s tests -f

tests: powermon-unit-tests powermon-integration-tests mppsolar-tests

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

def do_test(self, command, expected, respno=0):
try:
print(command, end=" ")
# print(command, end=" ")
result = subprocess.run(
[
"mppsolar",
Expand All @@ -53,7 +53,7 @@ def do_test(self, command, expected, respno=0):
# print(result.stderr)
self.assertEqual(f"CMD: {command}\n{result.stdout}", f"CMD: {command}\n{expected}")
self.assertEqual(result.returncode, 0)
print("OK")
# print("OK")
except subprocess.CalledProcessError as error:
print(error.stdout)
print(error.stderr)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@

def do_test(self, command, expected, respno=0):
try:
print(command, end=" ")
# print(command, end=" ")
result = subprocess.run(
[
"mppsolar",
Expand All @@ -156,7 +156,7 @@ def do_test(self, command, expected, respno=0):
# print(".")
self.assertEqual(f"CMD: {command}\n{result.stdout}", f"CMD: {command}\n{expected}")
self.assertEqual(result.returncode, 0)
print("OK")
# print("OK")
except subprocess.CalledProcessError as error:
print(error.stdout)
print(error.stderr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

def do_test(self, command, expected, respno=0):
try:
print(command, end=" ")
# print(command, end=" ")
result = subprocess.run(
[
"mppsolar",
Expand All @@ -56,7 +56,7 @@ def do_test(self, command, expected, respno=0):
# print(".")
self.assertEqual(f"CMD: {command}\n{result.stdout}", f"CMD: {command}\n{expected}")
self.assertEqual(result.returncode, 0)
print("OK")
# print("OK")
except subprocess.CalledProcessError as error:
print(error.stdout)
print(error.stderr)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

def do_test(self, filename):
try:
print(f"testing {filename}", end=' ')
# print(f"testing {filename}", end=' ')
expected = "Config validation successful\n"
result = subprocess.run(
["powermon", "-V", "-C", filename,], check=True, capture_output=True, text=True
)
self.assertEqual(result.stdout, expected)
self.assertEqual(result.returncode, 0)
print('OK')
# print('OK')
except subprocess.CalledProcessError as error:
print(error.stdout)
print(error.stderr)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c3708f7

Please sign in to comment.