Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
agkyra
Commits
d6a08445
Commit
d6a08445
authored
Sep 07, 2015
by
Giorgos Korfiatis
Browse files
Merge tests into main script
parent
d7266c70
Changes
2
Hide whitespace changes
Inline
Side-by-side
agkyra/scripts/agkyra
View file @
d6a08445
...
...
@@ -69,17 +69,24 @@ def run_cli(debug, extras=None):
agkcli
.
onecmd
(
' '
.
join
(
extras
or
[
'help'
,
]))
def
run_test
(
debug
,
extras
=
None
):
LOGGER
.
removeHandler
(
HANDLER
)
from
agkyra.scripts
import
test
test
.
main
(
debug
)
DISPATCH
=
{
'server'
:
run_server
,
'gui'
:
run_gui
,
'cli'
:
run_cli
,
'test'
:
run_test
,
}
parser
=
argparse
.
ArgumentParser
(
description
=
'Agkyra syncer launcher'
)
parser
.
add_argument
(
'--debug'
,
'-d'
,
action
=
'store_true'
,
help
=
"set logging level to 'debug'"
)
parser
.
add_argument
(
'component'
,
nargs
=
"?"
,
default
=
"gui"
,
help
=
"run 'server', 'cli', or 'gui' (default)"
)
help
=
"run
'test',
'server', 'cli', or 'gui' (default)"
)
parser
.
add_argument
(
'command'
,
nargs
=
"*"
,
help
=
"command in case of cli"
)
def
main
():
...
...
test.py
→
agkyra/scripts/
test.py
View file @
d6a08445
...
...
@@ -31,6 +31,7 @@ import unittest
import
mock
import
sqlite3
import
tempfile
import
argparse
from
functools
import
wraps
from
agkyra.config
import
AgkyraConfig
,
CONFIG_PATH
...
...
@@ -813,5 +814,23 @@ class AgkyraTest(unittest.TestCase):
handle
.
check_staged
(
live_info
)
def
set_debug
(
debug
):
level
=
logging
.
DEBUG
if
debug
else
logging
.
INFO
logger
.
setLevel
(
level
)
def
main
(
debug
):
set_debug
(
debug
)
runner
=
unittest
.
TextTestRunner
()
runner
.
run
(
unittest
.
makeSuite
(
AgkyraTest
))
parser
=
argparse
.
ArgumentParser
(
description
=
'Agkyra syncer launcher'
)
parser
.
add_argument
(
'--debug'
,
'-d'
,
action
=
'store_true'
,
help
=
"set logging level to 'debug'"
)
if
__name__
==
'__main__'
:
unittest
.
main
()
args
=
parser
.
parse_args
()
debug
=
args
.
debug
main
(
debug
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment