Commit ec7cb4cf authored by Samuel GAIST's avatar Samuel GAIST

[test][databases] Setup cleanup and disable push test

parent 2792f782
......@@ -59,7 +59,9 @@ class TestDatabaseLocal(core.AssetLocalTest):
"fork": "forked_database/1",
}
def setup(self):
def setUp(self):
super().setUp()
obj = get_first_procotol_template(prefix)
storage = PTStorage(tmp_prefix, obj)
if not storage.exists():
......@@ -72,7 +74,22 @@ class TestDatabaseLocal(core.AssetLocalTest):
class TestOnlineDatabases(core.OnlineAssetTestCase):
asset_type = "database"
storage_cls = Storage
object_map = {"pull": "simple/1", "diff": "simple/1", "push": "simple/1"}
object_map = {
"create": "new_database/1",
"pull": "simple/1",
"diff": "simple/1",
"push": "simple/1",
}
def setUp(self):
super().setUp()
obj = get_first_procotol_template(prefix)
storage = PTStorage(tmp_prefix, obj)
if not storage.exists():
exit_code, outputs = self.call(
"create", obj, prefix=tmp_prefix, asset_type=storage.asset_type
)
nose.tools.eq_(exit_code, 0, outputs)
def _modify_asset(self, asset_name):
"""Re-imp"""
......@@ -90,15 +107,19 @@ class TestOnlineDatabases(core.OnlineAssetTestCase):
def test_push_and_delete(self):
asset_name = self.object_map["push"]
# now push the new object and then delete it remotely
exit_code, output = self.call("push", asset_name)
nose.tools.eq_(exit_code, 1, output)
exit_code, output = self.call("rm", "--remote", asset_name)
nose.tools.eq_(exit_code, 2, output)
@core.skip_disconnected
def test_push_different_versions(self):
raise nose.SkipTest("Databases don't allow push")
@core.skip_disconnected
def test_fail_not_owner_push(self):
"""No owner so not need to test"""
raise nose.SkipTest("Database have no owner")
......
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