clan-cli: write some unit tests
This commit is contained in:
17
pkgs/clan-cli/tests/test_clan_admin.py
Normal file
17
pkgs/clan-cli/tests/test_clan_admin.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import argparse
|
||||
|
||||
import clan_admin
|
||||
|
||||
|
||||
def test_make_parser():
|
||||
parser = argparse.ArgumentParser()
|
||||
clan_admin.make_parser(parser)
|
||||
|
||||
# using fp fixture from pytest-subprocess
|
||||
def test_create(fp):
|
||||
cmd = ["nix", "flake", "init", "-t", fp.any()]
|
||||
fp.register(cmd)
|
||||
args = argparse.Namespace(folder="./my-clan")
|
||||
clan_admin.create(args)
|
||||
assert fp.call_count(cmd) == 1
|
||||
|
||||
Reference in New Issue
Block a user