1
0
mirror of synced 2024-11-12 01:30:52 +01:00

Merge pull request #16 from Stepland/add-tests

Add tests
This commit is contained in:
Stepland 2021-04-07 12:14:01 +02:00 committed by GitHub
commit 1e6ca3d372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 2 deletions

25
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Integrity checks
on:
push:
branches:
- master
- release-v*
pull_request:
branches:
- master
- release-v*
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: cd
run: cd $GITHUB_WORKSPACE
- name: pip install
run: pip install -r tests/requirements.txt
- name: pytest
run: pytest

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.vscode
build
_build
**.pyc

View File

@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft/2019-09/schema",
"$schema": "https://json-schema.org/draft/2019-09/schema",
"title": "memon",
"description": "A jubeat chart set description format based on json",
"type": "object",

2
tests/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
jschon<1
pytest<7

11
tests/test_schema.py Normal file
View File

@ -0,0 +1,11 @@
import json
from jschon.catalogue import jsonschema_2019_09
from jschon.jsonschema import JSONSchema
def test_that_the_schema_follows_the_metaschema():
jsonschema_2019_09.initialize()
with open("schema.json") as file:
raw = json.load(file)
schema = JSONSchema(raw)
schema.validate()