Skip to content

Commit

Permalink
Merge pull request #5 from dag-hammarskjold-library/jbukhari-patch-1
Browse files Browse the repository at this point in the history
Add sample script
  • Loading branch information
jbukhari authored May 13, 2024
2 parents cb3646e + 13e6e85 commit ca7d802
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/module.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

class Class():
def __init__():
def __init__(self):
return

def hello_world():
def hello_world(self):
return 'hello world'
17 changes: 17 additions & 0 deletions package/scripts/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

import sys
from argparse import ArgumentParser
from package.module import Class # rename package, module and class

def get_args():
parser = ArgumentParser()
parser.add_argument('--arg', help='')

return parser.parse_args()

def run():
args = get_args()
c = Class()
c.hello_world()

return
6 changes: 6 additions & 0 deletions package/tests/test_scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import sys
from package.scripts import script

def test_script():
sys.argv = ['--arg=test']
script.run()

0 comments on commit ca7d802

Please sign in to comment.