Skip to content

Commit

Permalink
Merge pull request #11 from deeagle/dev/task_simple-tests
Browse files Browse the repository at this point in the history
add simple dependency test
  • Loading branch information
deeagle authored Jun 28, 2024
2 parents 761260d + 28aeb60 commit 7c8e5e5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,20 @@ jobs:
uses: quentinguidee/pep8-action@v1
with:
arguments: '--max-line-length=120'

dependencies:
name: Check app runtime
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run main.py with --desc
run: |
python3 main.py --desc
22 changes: 19 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import dspyce
import json

Expand All @@ -15,9 +16,24 @@ def print_statistics(api_endpoint: dspyce.rest.RestAPI, human_readable=True) ->
print(stats)


if __name__ == "__main__":
def access_demo_api_and_print_statistics() -> None:
print("Demo implementation of a dspyce library")
url = "https://demo.dspace.org/server/api"
apiEndpoint = get_rest_api_connection(url)
print_statistics(apiEndpoint)
api_endpoint = get_rest_api_connection(url)
print_statistics(api_endpoint)
print("Demo successfully finished")


def print_app_description() -> None:
print("Demo implementation of a dspyce library")


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--desc', action='store_true', help='Request common description')
args = parser.parse_args()

if args.desc:
print_app_description()
else:
access_demo_api_and_print_statistics()

0 comments on commit 7c8e5e5

Please sign in to comment.