Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Nov 8, 2023
1 parent 9a906f4 commit b14d9af
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test index
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install reqs
run: |
pip install --upgrade pip
pip install --upgrade setuptools wheel
pip install pytest validators
- name: Run tests
run: pytest -vv
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
env/*
__pycache__/
15 changes: 15 additions & 0 deletions test_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import json
import validators

def test_index():
with open("index.json") as f:
index = json.load(f)

names = []
for i in index:
assert validators.url(i["download_url"])
assert i["download_url"].startswith("https://raw.githubusercontent.com/amidaware/reporting-templates/master")
names.append(i["name"])

# make sure names are all unique
assert len(names) == len(set(names))

0 comments on commit b14d9af

Please sign in to comment.