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
beat
beat.cmdline
Commits
559904cd
Commit
559904cd
authored
Oct 14, 2019
by
Samuel GAIST
Browse files
[test][core] Improve class separation and call method
parent
4be49938
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/test/core.py
View file @
559904cd
...
...
@@ -71,15 +71,16 @@ else:
skip_disconnected
=
skipif
(
disconnected
,
"missing test platform (%s)"
%
platform
)
class
Asset
Local
Test
:
class
Asset
Base
Test
:
asset_type
=
None
object_map
=
{}
storage_cls
=
None
def
__init__
(
self
):
nose
.
tools
.
assert_true
(
self
.
object_map
)
nose
.
tools
.
assert_true
(
self
.
asset_type
,
"Missing asset type"
)
def
teardown
(
self
):
def
setUp
(
self
):
pass
def
tearDown
(
self
):
cleanup
()
@
classmethod
...
...
@@ -121,6 +122,15 @@ class AssetLocalTest:
click
.
echo
(
result
.
output
)
return
result
.
exit_code
,
result
.
output
class
AssetLocalTest
(
AssetBaseTest
):
object_map
=
{}
storage_cls
=
None
def
__init__
(
self
):
super
().
__init__
()
nose
.
tools
.
assert_true
(
self
.
object_map
)
def
test_local_list
(
self
):
exit_code
,
outputs
=
self
.
call
(
"list"
)
nose
.
tools
.
eq_
(
exit_code
,
0
,
outputs
)
...
...
@@ -226,8 +236,13 @@ class OnlineTestCase(LiveServerTestCase):
use_prefix
=
kwargs
.
get
(
"prefix"
,
prefix
)
use_platform
=
kwargs
.
get
(
"platform"
,
cls
.
live_server_url
)
use_cache
=
kwargs
.
get
(
"cache"
,
"cache"
)
asset_type
=
kwargs
.
get
(
"asset_type"
,
cls
.
asset_type
)
cmd_group
=
common
.
TYPE_PLURAL
[
asset_type
]
if
"/"
in
cmd_group
:
cmd_group
=
cmd_group
.
split
(
"/"
)[
-
1
]
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
...
...
@@ -240,9 +255,11 @@ class OnlineTestCase(LiveServerTestCase):
token
,
"--user"
,
user
,
"--cache"
,
use_cache
,
"--platform"
,
use_platform
,
asset_type
,
cmd_group
,
]
+
list
(
args
),
catch_exceptions
=
False
,
...
...
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