diff --git a/test_cli.py b/test_cli.py new file mode 100644 index 0000000..dda57e2 --- /dev/null +++ b/test_cli.py @@ -0,0 +1,7 @@ +from shlax.cli import ConsoleScript + + +def test_parser(): + parser = ConsoleScript.Parser(['@host']) + parser.parse() + assert parser.targets['host'] == Ssh('host') diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..dda57e2 --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,7 @@ +from shlax.cli import ConsoleScript + + +def test_parser(): + parser = ConsoleScript.Parser(['@host']) + parser.parse() + assert parser.targets['host'] == Ssh('host') diff --git a/tests/test_play.py b/tests/test_play.py new file mode 100644 index 0000000..77e4c0b --- /dev/null +++ b/tests/test_play.py @@ -0,0 +1,5 @@ +from shlax.play import Play + + +def test_play_call(): + diff --git a/tests/test_shlax.py b/tests/test_shlax.py new file mode 100644 index 0000000..ef27661 --- /dev/null +++ b/tests/test_shlax.py @@ -0,0 +1,47 @@ +import copy + + +class Action: + args = dict( + step=None, + ) + + +class + user=dict( + doc='Username', + required=True, + ), + steps=dict( + up='Started', + down='Stopped', + ), + ) + + + def __init__(self, *args, **kwargs): + self.args = args + self.kwargs = kwargs + + def __call__(self, *args, **kwargs): + pass + + +class Target(Action): + def __call__(self, action): + action = copy.deepcopy(action) + action.target = self + + +class FakeAction(Action): + + + def __init__(self, user, path, *steps, **kwargs) + self.user = user + self.path = path + self.steps = steps + self.kwargs = kwargs + + +action = Action('root', '/test', 'up', 'rm') +target = Target() diff --git a/tests/test_ssh.py b/tests/test_ssh.py new file mode 100644 index 0000000..f3c355f --- /dev/null +++ b/tests/test_ssh.py @@ -0,0 +1,6 @@ +import os +import sys +import pytest + +if not os.getenv('CI'): + pytest.skip('Please run with ./shlaxfile.py test', allow_module_level=True)