Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds some basic tests * Updates testing pipeline * Adds Flake8 * Add build status badge to README
- Loading branch information
Showing
10 changed files
with
132 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/venv | ||
**/**/*.pyc | ||
**/**/*pycache* | ||
/*venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.6" | ||
|
||
install: | ||
- pip install flake8 | ||
- pip install -r requirements.txt | ||
|
||
script: | ||
- flake8 . --exclude "*venv*" | ||
- pytest -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
layout: property | ||
title: "charge" | ||
schemas: ["loan"] | ||
--- | ||
|
||
# charge | ||
|
||
--- | ||
|
||
The **charge** indicates the lender's charge or lien-level over the collateral. It is an integer with the minimum value being 0. | ||
|
||
1 indicates first charge, 2 second and so on. 0 indicates a combination of charge levels. |
4 changes: 2 additions & 2 deletions
4
documentation/properties/income_amount.md → ...mentation/properties/ref_income_amount.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
layout: property | ||
title: "uk_funding_type" | ||
schemas: ["account"] | ||
--- | ||
|
||
# uk_funding_type | ||
|
||
--- | ||
|
||
```bash | ||
├── a | ||
└── b | ||
``` | ||
|
||
The **uk_funding_type** refers to the UK liquidity classification as per [BIPRU 12.5][bipru-12-5] and [BIPRU 12.6][bipru-12-6]. | ||
|
||
--- | ||
[bipru-12-5]: https://www.handbook.fca.org.uk/handbook/BIPRU/12/5.html | ||
[bipru-12-6]: https://www.handbook.fca.org.uk/handbook/BIPRU/12/6.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /bin/bash | ||
|
||
echo "===> Running Tests..." | ||
|
||
echo "===> Flake8 Running..." | ||
flake8 . --exclude "*venv*" | ||
echo "===> Flake8 Finished" | ||
|
||
echo "===> PyTest Running..." | ||
pytest -v | ||
echo "===> PyTest Finished" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import os | ||
|
||
|
||
HOME = os.path.realpath(".") | ||
SCHEMAS_DIR = os.path.join(HOME, 'v1-dev') | ||
DOCS_DIR = os.path.join(HOME, "documentation", "properties") | ||
|
||
_, _, filenames = next(os.walk(SCHEMAS_DIR), (None, None, [])) | ||
SCHEMA_FILES = [f for f in filenames if f.endswith(".json")] | ||
SCHEMA_NAMES = [f.split(".json")[0] for f in SCHEMA_FILES] | ||
|
||
_, _, filenames = next(os.walk(DOCS_DIR), (None, None, [])) | ||
DOC_FILES = [f for f in filenames if f.endswith(".md")] | ||
DOC_NAMES = [f.split(".md")[0] for f in DOC_FILES] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import json | ||
import os | ||
import unittest | ||
from . import ( | ||
DOC_NAMES, | ||
SCHEMAS_DIR, | ||
SCHEMA_FILES, | ||
SCHEMA_NAMES, | ||
) | ||
|
||
|
||
class TestSchemas(unittest.TestCase): | ||
|
||
def test_schemas_and_docs_found(self): | ||
self.assertTrue(SCHEMA_NAMES) | ||
self.assertTrue(DOC_NAMES) | ||
|
||
def test_jsons_are_valid(self): | ||
for schema_name in SCHEMA_FILES: | ||
with open(os.path.join(SCHEMAS_DIR, schema_name)) as json_schema: | ||
self.assertTrue(json.load(json_schema)) | ||
|
||
def test_property_has_docs(self): | ||
"""TODO: add documentation for adjustment schema""" | ||
properties = set() | ||
for schema_name in SCHEMA_FILES: | ||
with open(os.path.join(SCHEMAS_DIR, schema_name)) as json_schema: | ||
schema = json.load(json_schema) | ||
if schema_name == "common.json": | ||
props = schema.keys() | ||
else: | ||
props = schema["properties"].keys() | ||
|
||
{properties.add(p) for p in props} | ||
|
||
self.assertTrue(properties) | ||
|
||
no_docs = [] | ||
for p in properties: | ||
if p not in DOC_NAMES: | ||
no_docs.append(p) | ||
|
||
print("No documenation found for properties: {}".format(no_docs)) | ||
# TODO: Add docs! | ||
# self.assertFalse( | ||
# no_docs, | ||
# "No documenation found for properties: {}".format(no_docs) | ||
# ) | ||
# for doc in DOC_NAMES: | ||
# self.assertIn(doc, properties) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters