Skip to content

Commit d726382

Browse files
committed
test: pytest implementation
1 parent 54beb6e commit d726382

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ ed25519==1.5
44
py-machineid==0.4.1
55
pycparser==2.21
66
winregistry==1.1.1
7+
argparse~=1.4.0
8+
pytest~=7.4.0

test_main.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import subprocess
2+
import unittest
3+
4+
5+
class TestMain(unittest.TestCase):
6+
def test_main(self):
7+
# Run the application
8+
process = subprocess.run(
9+
["python3", "main.py", "--fingerprint", "198e9fe586114844f6a4eaca5069b41a7ed43fb5a2df84892b69826d64573e39",
10+
"--path-license", "examples/license.lic", "--path-machine", "examples/machine.lic"], stdout=subprocess.PIPE)
11+
12+
# Assert the output is what we expected
13+
output = process.stdout.decode("utf-8")
14+
expected_output = "Hello, World!"
15+
assert expected_output in output

0 commit comments

Comments
 (0)