This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AP-867] Make unit tests to work (#8)
- Loading branch information
Showing
6 changed files
with
36 additions
and
195 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
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 |
---|---|---|
|
@@ -24,8 +24,7 @@ | |
extras_require={ | ||
'test': [ | ||
'pylint', | ||
'ipdb', | ||
'nose' | ||
'pytest' | ||
] | ||
}, | ||
python_requires='>=3.6', | ||
|
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
import os | ||
import singer | ||
import jsonschema | ||
|
||
class TestSchemas: | ||
""" Test schemas """ | ||
schemas_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'tap_slack', 'schemas')) | ||
|
||
def get_schemas(self): | ||
"""Function to get all json schema paths""" | ||
schemas = [] | ||
for f in os.listdir(self.schemas_dir): | ||
if os.path.isfile(os.path.join(self.schemas_dir, f)): | ||
if '.json' in f: | ||
schemas.append(os.path.join(self.schemas_dir, f)) | ||
|
||
return schemas | ||
|
||
def test_schemas(self): | ||
"""Check if every schema is a valid JSON Schema""" | ||
for schema in self.get_schemas(): | ||
s = singer.utils.load_json(schema) | ||
assert jsonschema.Draft7Validator(s).check_schema(s) is None |
This file was deleted.
Oops, something went wrong.