Commit a08bdd9a authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][core] Add proper support for testing the fork command

It will ensure it succeeds if the type can be forked and fail
otherwise.
parent 949d5be3
......@@ -142,14 +142,17 @@ class AssetLocalTest:
obj = self.object_map["create"]
obj2 = self.object_map["fork"]
self.test_create(obj)
exit_code, outputs = self.call("fork", obj, obj2, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 0, outputs)
s = self.storage_cls(tmp_prefix, obj2)
nose.tools.assert_true(s.exists())
# check fork status
with common.Selector(tmp_prefix) as selector:
nose.tools.eq_(selector.forked_from(self.asset_type, obj2), obj)
if selector.can_fork(self.asset_type):
exit_code, outputs = self.call("fork", obj, obj2, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 0, outputs)
selector.load()
s = self.storage_cls(tmp_prefix, obj2)
nose.tools.assert_true(s.exists())
nose.tools.eq_(selector.forked_from(self.asset_type, obj2), obj)
else:
exit_code, outputs = self.call("fork", obj, obj2, prefix=tmp_prefix)
nose.tools.assert_not_equal(exit_code, 0)
def test_delete_local(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