wilson194 / labelord Goto Github PK
View Code? Open in Web Editor NEWA simple server-based application that synchronizes labels through github repositories.
License: GNU General Public License v3.0
A simple server-based application that synchronizes labels through github repositories.
License: GNU General Public License v3.0
In READMEs and setup.py
is information that license is "GNU", but actually "GNU" has more licenses: GNU GPL, GNU LGPL, GNU FDL (+ version). It might be better to tell which one (although GPL is the most known one)...
Also there is typo in author's name in setup.py
...
With v0.2
it is not possible to import cli
(all tests from tests_cli
ends with an error) nor use CLI anymore when default config is not available:
% python labelord.py --help
No webhook secret has been provided
It is caused because you check the configuration when initializing the module variable app
. The check of configuration should be postponed (when needed or before first request and every time when reload_config
is called = explicit "config is ready").
Other stuff seems to work well and this fix is just changing few calls.
I give you 4.5+1 points because:
sphinx-build: command not found
by the way... it is not PiPy but PyPI (Python Package Index)
requirements.txt
and not with setup.py
? Is it necessary?Other seems OK to me, please fix this minor thing so I can give you 5 points.
(This is informative only.)
I've noticed you are using camelCase for variables. For Python, snake_case is recommended here. See http://pep8.org/#method-names-and-instance-variables
See MarekSuchanek/labelord_tests#6
Running tests from MarekSuchanek/labelord_tests@c995942
$ LABELORD_SESSION_SPY=off python -m pytest -v tests/
============================================== test session starts ==============================================
platform linux -- Python 3.6.2, pytest-3.2.3, py-1.4.34, pluggy-0.4.0 -- /home/churchyard/ownCloud/Škola/171/students/__labelord_venv__/bin/python
cachedir: .cache
rootdir: /home/churchyard/ownCloud/Škola/171/students/horacj10__Wilson194/MI-PYT-DU1, inifile:
plugins: betamax-0.8.0
collected 81 items
...
tests/test_run_tricky.py::test_help_list_labels[True] FAILED
tests/test_run_tricky.py::test_help_list_labels[False] FAILED
tests/test_run_tricky.py::test_help_list_repos[True] FAILED
tests/test_run_tricky.py::test_help_list_repos[False] FAILED
tests/test_run_tricky.py::test_help_list_run[True] FAILED
tests/test_run_tricky.py::test_help_list_run[False] FAILED
...
tests/test_run_tricky.py::test_precedence_template_repo FAILED
...
=================================================== FAILURES ====================================================
__________________________________________ test_help_list_labels[True] __________________________________________
invoker_norec = <function invoker.<locals>.invoker_inner at 0x7f9686736d08>, isolated = True
@pytest.mark.parametrize('isolated', [True, False])
def test_help_list_labels(invoker_norec, isolated):
# There must be standard click help describing options
# and commands (you should write description for each)
#
# Local default config is not required (no token for help is OK)!
#
# It could look like this (help text may differ):
# Usage: labelord.py list_labels [OPTIONS] REPOSITORY
#
# Listing labels of desired repository.
#
# Options:
# --help Show this message and exit.
invocation = invoker_norec('list_labels', '--help', isolated=isolated)
> assert invocation.result.exit_code == 0
E assert 3 == 0
E + where 3 = <Result SystemExit(3,)>.exit_code
E + where <Result SystemExit(3,)> = <conftest.LabelordInvocation object at 0x7f96867007f0>.result
tests/test_run_tricky.py:117: AssertionError
_________________________________________ test_help_list_labels[False] __________________________________________
invoker_norec = <function invoker.<locals>.invoker_inner at 0x7f9686736bf8>, isolated = False
@pytest.mark.parametrize('isolated', [True, False])
def test_help_list_labels(invoker_norec, isolated):
# There must be standard click help describing options
# and commands (you should write description for each)
#
# Local default config is not required (no token for help is OK)!
#
# It could look like this (help text may differ):
# Usage: labelord.py list_labels [OPTIONS] REPOSITORY
#
# Listing labels of desired repository.
#
# Options:
# --help Show this message and exit.
invocation = invoker_norec('list_labels', '--help', isolated=isolated)
> assert invocation.result.exit_code == 0
E assert 3 == 0
E + where 3 = <Result SystemExit(3,)>.exit_code
E + where <Result SystemExit(3,)> = <conftest.LabelordInvocation object at 0x7f9686761cf8>.result
tests/test_run_tricky.py:117: AssertionError
__________________________________________ test_help_list_repos[True] ___________________________________________
invoker_norec = <function invoker.<locals>.invoker_inner at 0x7f96867097b8>, isolated = True
@pytest.mark.parametrize('isolated', [True, False])
def test_help_list_repos(invoker_norec, isolated):
# There must be standard click help describing options
# and commands (you should write description for each)
#
# Local default config is not required (no token for help is OK)!
#
# It could look like this (help text may differ):
# Usage: labelord.py list_repos [OPTIONS]
#
# Listing accessible repositories.
#
# Options:
# --help Show this message and exit.
invocation = invoker_norec('list_repos', '--help', isolated=isolated)
> assert invocation.result.exit_code == 0
E assert 3 == 0
E + where 3 = <Result SystemExit(3,)>.exit_code
E + where <Result SystemExit(3,)> = <conftest.LabelordInvocation object at 0x7f968688e1d0>.result
tests/test_run_tricky.py:137: AssertionError
__________________________________________ test_help_list_repos[False] __________________________________________
invoker_norec = <function invoker.<locals>.invoker_inner at 0x7f9686771488>, isolated = False
@pytest.mark.parametrize('isolated', [True, False])
def test_help_list_repos(invoker_norec, isolated):
# There must be standard click help describing options
# and commands (you should write description for each)
#
# Local default config is not required (no token for help is OK)!
#
# It could look like this (help text may differ):
# Usage: labelord.py list_repos [OPTIONS]
#
# Listing accessible repositories.
#
# Options:
# --help Show this message and exit.
invocation = invoker_norec('list_repos', '--help', isolated=isolated)
> assert invocation.result.exit_code == 0
E assert 3 == 0
E + where 3 = <Result SystemExit(3,)>.exit_code
E + where <Result SystemExit(3,)> = <conftest.LabelordInvocation object at 0x7f96867158d0>.result
tests/test_run_tricky.py:137: AssertionError
___________________________________________ test_help_list_run[True] ____________________________________________
invoker_norec = <function invoker.<locals>.invoker_inner at 0x7f9686794a60>, isolated = True
@pytest.mark.parametrize('isolated', [True, False])
def test_help_list_run(invoker_norec, isolated):
# There must be standard click help describing options
# and commands (you should write description for each)
#
# Local default config is not required (no token for help is OK)!
#
# It could look like this (types and help texts may differ):
# Usage: labelord.py run [OPTIONS] <update|replace>
#
# Run labels processing.
#
# Options:
# -r, --template-repo TEXT Repository which serves as labels template.
# -d, --dry-run Proceed with just dry run.
# -v, --verbose Really exhaustive output.
# -q, --quiet No output at all.
# -a, --all-repos Run for all repositories available.
# --help Show this message and exit.
invocation = invoker_norec('run', '--help', isolated=isolated)
> assert invocation.result.exit_code == 0
E assert 3 == 0
E + where 3 = <Result SystemExit(3,)>.exit_code
E + where <Result SystemExit(3,)> = <conftest.LabelordInvocation object at 0x7f9686758048>.result
tests/test_run_tricky.py:162: AssertionError
___________________________________________ test_help_list_run[False] ___________________________________________
invoker_norec = <function invoker.<locals>.invoker_inner at 0x7f96867369d8>, isolated = False
@pytest.mark.parametrize('isolated', [True, False])
def test_help_list_run(invoker_norec, isolated):
# There must be standard click help describing options
# and commands (you should write description for each)
#
# Local default config is not required (no token for help is OK)!
#
# It could look like this (types and help texts may differ):
# Usage: labelord.py run [OPTIONS] <update|replace>
#
# Run labels processing.
#
# Options:
# -r, --template-repo TEXT Repository which serves as labels template.
# -d, --dry-run Proceed with just dry run.
# -v, --verbose Really exhaustive output.
# -q, --quiet No output at all.
# -a, --all-repos Run for all repositories available.
# --help Show this message and exit.
invocation = invoker_norec('run', '--help', isolated=isolated)
> assert invocation.result.exit_code == 0
E assert 3 == 0
E + where 3 = <Result SystemExit(3,)>.exit_code
E + where <Result SystemExit(3,)> = <conftest.LabelordInvocation object at 0x7f96868787b8>.result
tests/test_run_tricky.py:162: AssertionError
_________________________________________ test_precedence_template_repo _________________________________________
invoker = <function invoker.<locals>.invoker_inner at 0x7f9686709a60>
utils = <conftest.Utils object at 0x7f968672f278>
def test_precedence_template_repo(invoker, utils):
# repo4 is empty and has higher precedence than repo3
# in the config
invocation = invoker('-c', utils.config('config_templaterepo'),
'run', 'update', '-r', 'MarekSuchanek/repo4',
session_expectations={
'get': 3,
'post': 0,
'patch': 0,
'delete': 0
})
lines = invocation.result.output.split('\n')
> assert invocation.result.exit_code == 0
E assert 2 == 0
E + where 2 = <Result SystemExit(2,)>.exit_code
E + where <Result SystemExit(2,)> = <conftest.LabelordInvocation object at 0x7f968672fbe0>.result
tests/test_run_tricky.py:198: AssertionError
====================================== 7 failed, 74 passed in 0.76 seconds ======================================
Use v0.1.1
etc. tags if you will provide next iteration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.