agent: Convert unit test_commands to pytest

This commit is contained in:
Ilija Lazoroski 2021-06-17 20:05:40 +02:00 committed by Ilija Lazoroski
parent 4d71ed42a5
commit 24bb79af6a
1 changed files with 19 additions and 26 deletions

View File

@ -1,30 +1,23 @@
import unittest
from infection_monkey.utils.commands import build_monkey_commandline_explicitly
class TestHelpers(unittest.TestCase):
def test_build_monkey_commandline_explicitly(self):
test1 = [
"-p",
"101010",
"-t",
"10.10.101.10",
"-s",
"127.127.127.127:5000",
"-d",
"0",
"-l",
"C:\\windows\\abc",
"-vp",
"80",
]
result1 = build_monkey_commandline_explicitly(
101010, "10.10.101.10", "127.127.127.127:5000", 0, "C:\\windows\\abc", 80
)
def test_build_monkey_commandline_explicitly():
test1 = [
"-p",
"101010",
"-t",
"10.10.101.10",
"-s",
"127.127.127.127:5000",
"-d",
"0",
"-l",
"C:\\windows\\abc",
"-vp",
"80",
]
result1 = build_monkey_commandline_explicitly(
101010, "10.10.101.10", "127.127.127.127:5000", 0, "C:\\windows\\abc", 80
)
self.assertEqual(test1, result1)
if __name__ == "__main__":
unittest.main()
assert test1 == result1