Commit 272c41a3 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][core] Refactored handling of call and create

This allows for other tests to re-use these class methods
parent d35ed362
......@@ -62,13 +62,14 @@ class AssetLocalTest:
def teardown(self):
def call(self, *args, **kwargs):
def call(cls, *args, **kwargs):
"""A central mechanism to call the main routine with the right parameters"""
use_prefix = kwargs.get("prefix", prefix)
use_platform = kwargs.get("platform", platform)
use_cache = kwargs.get("cache", "cache")
asset_type = kwargs.get("asset_type", self.asset_type)
asset_type = kwargs.get("asset_type", cls.asset_type)
runner = CliRunner()
with runner.isolated_filesystem():
......@@ -108,14 +109,18 @@ class AssetLocalTest:
exit_code, outputs ="check", self.object_map["invalid"]), 1, outputs)
def test_create(self, obj=None):
obj = obj or self.object_map["create"]
exit_code, outputs ="create", obj, prefix=tmp_prefix)
def create(cls, obj=None):
obj = obj or cls.object_map["create"]
exit_code, outputs ="create", obj, prefix=tmp_prefix), 0, outputs)
s = self.storage_cls(tmp_prefix, obj)
s = cls.storage_cls(tmp_prefix, obj)
return s
def test_create(self, obj=None):
def test_new_version(self):
obj = self.object_map["create"]
obj2 = self.object_map["new"]
......@@ -144,7 +149,7 @@ class AssetLocalTest:
def test_delete_local(self):
obj = self.object_map["create"]
storage = self.test_create(obj)
storage = self.create(obj)
exit_code, outputs ="rm", obj, prefix=tmp_prefix), 0, outputs)
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