From 17b6efe82e6a558353b011c543489eaaf3a6d3ac Mon Sep 17 00:00:00 2001 From: philippeitis <33013301+philippeitis@users.noreply.github.com> Date: Sun, 8 Mar 2020 13:35:01 -0700 Subject: [PATCH] Create basic tests for generate_magic_commands() --- tests/test_cli.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/test_cli.py diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 00000000..69542f6f --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,14 @@ +import os +import unittest +import jc.cli + + +class MyTests(unittest.TestCase): + def test_cli(self): + commands = { + "jc -p systemctl list-sockets": "systemctl list-sockets | jc --systemctl-ls -p", + "jc -p systemctl list-unit-files": "systemctl list-unit-files | jc --systemctl-luf -p", + } + + for command, expected_command in commands.items(): + self.assertEquals(jc.cli.generate_magic_command(command.split(" "))[1], expected_command)