Skip to content

Commit

Permalink
CLI skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
sbscully committed Jul 26, 2024
1 parent 0120631 commit c9bf650
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opencage/command_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from opencage.geocoder import OpenCageGeocode

def main():
print("Running opencage")
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
url="https://github.com/OpenCageData/python-opencage-geocoder/",
download_url="https://github.com/OpenCageData/python-opencage-geocoder/tarball/2.1.0",
license="BSD",
entry_points={
'console_scripts': [
'opencage=opencage.command_line:main'
]
},
packages=find_packages(),
include_package_data=True,
zip_safe=False,
Expand Down
9 changes: 9 additions & 0 deletions test/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import pytest
import httpretty

from opencage.command_line import main

def test_basic(capfd):
main()
out, err = capfd.readouterr()
assert out == "Running opencage\n"

0 comments on commit c9bf650

Please sign in to comment.