Commit 559904cd authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][core] Improve class separation and call method

parent 4be49938
......@@ -71,15 +71,16 @@ else:
skip_disconnected = skipif(disconnected, "missing test platform (%s)" % platform)
class AssetLocalTest:
class AssetBaseTest:
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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment