Commit 40c858f8 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][core] Improve handling of asset creation and deletion

parent e12f23fc
......@@ -146,6 +146,13 @@ class AssetBaseTest(BaseTest):
nose.tools.assert_true(storage.exists())
return storage
@classmethod
def delete(cls, obj):
exit_code, outputs = cls.call("rm", obj, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 0, outputs)
storage = cls.storage_cls(tmp_prefix, obj)
nose.tools.assert_false(storage.exists())
@classmethod
def call(cls, *args, **kwargs):
nose.tools.assert_is_not_none(cls.asset_type, "Missing value for asset_type")
......@@ -178,7 +185,7 @@ class AssetLocalTest(AssetBaseTest):
def test_new_version(self):
obj = self.object_map["create"]
obj2 = self.object_map["new"]
self.test_create(obj)
self.create(obj)
exit_code, outputs = self.call("version", obj, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 0, outputs)
s = self.storage_cls(tmp_prefix, obj2)
......@@ -191,7 +198,7 @@ class AssetLocalTest(AssetBaseTest):
def test_fork(self):
obj = self.object_map["create"]
obj2 = self.object_map["fork"]
self.test_create(obj)
self.create(obj)
with common.Selector(tmp_prefix) as selector:
if selector.can_fork(self.asset_type):
exit_code, outputs = self.call("fork", obj, obj2, prefix=tmp_prefix)
......@@ -206,10 +213,8 @@ class AssetLocalTest(AssetBaseTest):
def test_delete_local(self):
obj = self.object_map["create"]
storage = self.create(obj)
exit_code, outputs = self.call("rm", obj, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 0, outputs)
nose.tools.assert_false(storage.exists())
self.create(obj)
self.delete(obj)
def test_delete_local_unexisting(self):
obj = self.object_map["create"]
......
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