Skip to content

Commit

Permalink
add script entry point for package
Browse files Browse the repository at this point in the history
  • Loading branch information
glemieux committed Mar 11, 2024
1 parent a238eea commit 36c1707
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ addopts = [
"--verbose",
"--color=yes",
]
[project.scripts]
fates-landusedata = "landusedata._main:main"
22 changes: 10 additions & 12 deletions tests/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
from landusedata._main import main

# TODO: parameterize this
def test_main(capsys):
"""
Postive case testing for choice input
Note that the regridfile is a global argument to all landusedata subcommands
and thus must come last.
"""
statefile = 'statefile'
regridfile = 'regridfile'
main(['luh2',statefile,regridfile])
out, err = capsys.readouterr()
assert out == 'calling luh2 code: {},{}\n'.format(regridfile,statefile)
assert err == ''
# def test_main_luh2(capsys):
# """
# Postive case testing for choice input
# Note that the regridfile is a global argument to all landusedata subcommands
# and thus must come last.
# """
# main(['luh2'])
# out, err = capsys.readouterr()
# assert out == 'calling luh2 code: {},{}\n'.format(regridfile,statefile)
# assert err == ''

def test_main_neg(capsys):
"""
Expand Down

0 comments on commit 36c1707

Please sign in to comment.