-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: created tests for config content check
- Loading branch information
1 parent
56ccb1e
commit faa6ef5
Showing
9 changed files
with
165 additions
and
110 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
Submodule opensource
added at
9bb1cf
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,64 +0,0 @@ | ||
amqp==2.5.0 | ||
asn1crypto==0.24.0 | ||
astroid==2.2.5 | ||
atomicwrites==1.3.0 | ||
attrs==19.1.0 | ||
autopep8==1.4.4 | ||
bcrypt==3.1.7 | ||
billiard==3.6.0.0 | ||
cached-property==1.5.1 | ||
celery==4.3.0 | ||
certifi==2019.6.16 | ||
cffi==1.12.3 | ||
chardet==3.0.4 | ||
Click==7.0 | ||
cryptography==2.7 | ||
docker==3.7.3 | ||
docker-compose==1.24.1 | ||
docker-pycreds==0.4.0 | ||
dockerpty==0.4.1 | ||
docopt==0.6.2 | ||
Flask==1.0.3 | ||
github3.py==1.3.0 | ||
idna==2.7 | ||
importlib-metadata==0.18 | ||
isort==4.3.21 | ||
itsdangerous==1.1.0 | ||
Jinja2==2.10.1 | ||
jsonschema==2.6.0 | ||
jwcrypto==0.6.0 | ||
kombu==4.6.3 | ||
lazy-load==0.8.2 | ||
lazy-object-proxy==1.4.1 | ||
MarkupSafe==1.1.1 | ||
mccabe==0.6.1 | ||
more-itertools==7.2.0 | ||
packaging==19.0 | ||
paramiko==2.6.0 | ||
pep8==1.7.1 | ||
pluggy==0.12.0 | ||
py==1.8.0 | ||
pycodestyle==2.5.0 | ||
pycparser==2.19 | ||
pylint==2.3.1 | ||
PyNaCl==1.3.0 | ||
pyparsing==2.4.1.1 | ||
pytest==5.0.1 | ||
python-dateutil==2.8.0 | ||
python-dotenv==0.10.3 | ||
pytz==2019.1 | ||
PyYAML==3.13 | ||
redis==3.2.1 | ||
requests==2.20.1 | ||
six==1.12.0 | ||
texttable==0.9.1 | ||
typed-ast==1.4.0 | ||
uritemplate==3.0.0 | ||
urllib3==1.24.3 | ||
vine==1.3.0 | ||
wcwidth==0.1.7 | ||
websocket-client==0.56.0 | ||
Werkzeug==0.15.4 | ||
wrapt==1.11.2 | ||
xmltodict==0.12.0 | ||
zipp==0.5.2 | ||
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 |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
"click>=7.0", | ||
"PyYAML>=3.13", | ||
"python-dotenv>=0.10.3", | ||
"lazy-load>=0.8.2", | ||
] | ||
|
||
setup( | ||
|
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,97 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of Autobot. | ||
# Copyright (C) 2015-2019 CERN. | ||
# | ||
# Autobot is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""Test configuration file.""" | ||
|
||
import pytest | ||
import yaml | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def info(tmpdir_factory): | ||
"""Mock info for configuration testing.""" | ||
mock = { | ||
"orgs": { | ||
"org1": { | ||
"repositories": { | ||
"org1foo1": { | ||
"description": "Description for org1foo1", | ||
"maintainers": ["org1foo", "mix1"], | ||
}, | ||
"org1foo2": { | ||
"description": "Description for org1foo2", | ||
"maintainers": ["org1foo", "mix2", "mix3"], | ||
}, | ||
"org1foo3": { | ||
"description": "Description for org1foo3", | ||
"maintainers": ["org1foo", "mix1", "mix3"], | ||
}, | ||
"org1bar1": { | ||
"description": "Description for org1bar1", | ||
"maintainers": ["org1bar", "mix1"], | ||
}, | ||
"org1bar2": { | ||
"description": "Description for org1bar2", | ||
"maintainers": ["org1bar", "mix2"], | ||
}, | ||
"org1baz1": { | ||
"description": "Description for org1baz1", | ||
"maintainers": ["org1baz", "mix2", "mix3"], | ||
}, | ||
} | ||
}, | ||
"org2": { | ||
"repositories": { | ||
"org2foo1": { | ||
"description": "Description for org2foo1", | ||
"maintainers": ["org2foo", "mix3"], | ||
}, | ||
"org2bar1": { | ||
"description": "Description for org2bar1", | ||
"maintainers": ["org2bar", "mix1"], | ||
}, | ||
"org2bar2": { | ||
"description": "Description for org2bar2", | ||
"maintainers": ["org2bar", "mix1", "mix2"], | ||
}, | ||
"org2baz1": { | ||
"description": "Description for org2baz1", | ||
"maintainers": ["org2baz", "mix2", "mix3"], | ||
}, | ||
"org2baz2": { | ||
"description": "Description for org2baz2", | ||
"maintainers": ["org2baz", "mix1"], | ||
}, | ||
} | ||
}, | ||
} | ||
} | ||
d = tmpdir_factory.mktemp("tests").join("repositories.yml") | ||
with open(d, "w") as outfile: | ||
yaml.dump(mock, outfile, default_flow_style=False) | ||
return str(d) | ||
|
||
|
||
@pytest.fixture | ||
def config(info, **kwargs): | ||
"""Configuration testing fixture.""" | ||
from autobot.config import Config | ||
|
||
owner = kwargs.get("owner", "org1") | ||
repos = kwargs.get("repos", []) | ||
maintainers = kwargs.get("maintainers", []) | ||
github_token = kwargs.get("github_token", "some token") | ||
info_path = kwargs.get("info_path", info) | ||
|
||
return Config( | ||
owner=owner, | ||
repos=repos, | ||
maintainers=maintainers, | ||
github_token=github_token, | ||
info_path=info_path, | ||
) |
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