forked from clan/clan-core
clan-cli/tests: fixup imports
This commit is contained in:
parent
875ee61aa0
commit
7f937077cf
@ -1,11 +1,11 @@
|
||||
import argparse
|
||||
|
||||
import clan_admin
|
||||
from clan_cli import admin
|
||||
|
||||
|
||||
def test_make_parser():
|
||||
parser = argparse.ArgumentParser()
|
||||
clan_admin.make_parser(parser)
|
||||
admin.register_parser(parser)
|
||||
|
||||
|
||||
# using fp fixture from pytest-subprocess
|
||||
@ -13,5 +13,5 @@ def test_create(fp):
|
||||
cmd = ["nix", "flake", "init", "-t", fp.any()]
|
||||
fp.register(cmd)
|
||||
args = argparse.Namespace(folder="./my-clan")
|
||||
clan_admin.create(args)
|
||||
admin.create(args)
|
||||
assert fp.call_count(cmd) == 1
|
||||
|
@ -1,11 +1,11 @@
|
||||
import sys
|
||||
|
||||
import clan
|
||||
import clan_cli
|
||||
import pytest
|
||||
|
||||
|
||||
def test_no_args(capsys):
|
||||
clan.clan()
|
||||
clan_cli.main()
|
||||
captured = capsys.readouterr()
|
||||
assert captured.out.startswith("usage:")
|
||||
|
||||
@ -13,6 +13,6 @@ def test_no_args(capsys):
|
||||
def test_help(capsys, monkeypatch):
|
||||
monkeypatch.setattr(sys, "argv", ["", "--help"])
|
||||
with pytest.raises(SystemExit):
|
||||
clan.clan()
|
||||
clan_cli.main()
|
||||
captured = capsys.readouterr()
|
||||
assert captured.out.startswith("usage:")
|
||||
|
Loading…
Reference in New Issue
Block a user