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

[test] Ensure that assets that can't be pushed or deleted are failing properly

parent 2423e854
......@@ -68,7 +68,7 @@ class TestDatabaseLocal(core.AssetLocalTest):
nose.tools.eq_(exit_code, 0, outputs)
class TestOnlinDatabases(core.OnlineAssetTestCase):
class TestOnlineDatabases(core.OnlineAssetTestCase):
asset_type = "database"
storage_cls = Storage
object_map = {"pull": "simple/1", "diff": "simple/1"}
......@@ -85,6 +85,16 @@ class TestOnlinDatabases(core.OnlineAssetTestCase):
database.data["root_folder"] = "/a/different/path"
database.write()
@core.skip_disconnected
def test_push_and_delete(self):
asset_name = self.object_map["pull"]
# now push the new object and then delete it remotely
exit_code, output = self.call("push", asset_name, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 1, output)
exit_code, output = self.call("rm", "--remote", asset_name, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 2, output)
class TestView(core.AssetBaseTest):
asset_type = "database"
......
......@@ -36,8 +36,12 @@
# Basic tests for the command line beat program: plotterparameters
import nose.tools
from beat.core.plotterparameter import Storage, Plotterparameter
from beat.core.test.utils import slow
from . import core
from . import tmp_prefix
......@@ -46,7 +50,11 @@ class TestOnlinePlotterParameters(core.OnlineAssetTestCase):
asset_type = "plotterparameter"
storage_cls = Storage
object_map = {"pull": "plot/bar/1", "diff": "plot/bar/1"}
object_map = {
"pull": "plot/bar/1",
"diff": "plot/bar/1",
"create": "user/newobject/1",
}
def _modify_asset(self, asset_name):
"""Re-imp"""
......@@ -55,6 +63,18 @@ class TestOnlinePlotterParameters(core.OnlineAssetTestCase):
plotterparameter.data["value"] = {"dummy": "int64"}
plotterparameter.write()
@slow
@core.skip_disconnected
def test_push_and_delete(self):
asset_name = self.object_map["create"]
self.create(asset_name)
# now push the new object and then delete it remotely
exit_code, output = self.call("push", asset_name, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 2, output)
exit_code, output = self.call("rm", "--remote", asset_name, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 2, output)
class TestPlotterparameterLocal(core.AssetLocalTest):
storage_cls = Storage
......
......@@ -52,7 +52,11 @@ class TestOnlinePlotters(core.OnlineAssetTestCase):
asset_type = "plotter"
storage_cls = Storage
object_map = {"pull": "plot/bar/1", "diff": "plot/bar/1"}
object_map = {
"pull": "plot/bar/1",
"diff": "plot/bar/1",
"create": "user/newobject/1",
}
def _modify_asset(self, asset_name):
"""Re-imp"""
......@@ -61,6 +65,18 @@ class TestOnlinePlotters(core.OnlineAssetTestCase):
plotter.data["language"] = "cxx"
plotter.write()
@slow
@core.skip_disconnected
def test_push_and_delete(self):
asset_name = self.object_map["create"]
self.create(asset_name)
# now push the new object and then delete it remotely
exit_code, output = self.call("push", asset_name, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 2, output)
exit_code, output = self.call("rm", "--remote", asset_name, prefix=tmp_prefix)
nose.tools.eq_(exit_code, 2, output)
@slow
@core.skip_disconnected
def test_pull_one_check_deps(self, obj=None):
......
Supports Markdown
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