A collection of classes and commands for automated command line scripting using Python.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
735 B

4 years ago
from scripttease.library.commands import command_factory, ItemizedCommand
from scripttease.library.commands.python import Pip
from scripttease.library.overlays import Overlay
def test_command_factory():
overlay = Overlay("ubuntu")
overlay.load()
command = command_factory("nonexistent", "non existent command", overlay)
assert command is None
command = command_factory("pip", "install pillow", overlay)
assert command is None
command = command_factory("pip", "install pillow", overlay, "Pillow")
assert isinstance(command, Pip)
command = command_factory("pip", "install various", overlay, "$item", items=["Pillow", "pyscopg2-binary", "django"])
assert isinstance(command, ItemizedCommand)