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

[test][core] Create base class with common remote tests

parent 779281c3
......@@ -47,6 +47,7 @@ from click.testing import CliRunner
from beat.core.test.utils import cleanup
from beat.core.test.utils import skipif
from beat.core.test.utils import slow
from beat.cmdline.scripts import main_cli
from .. import common
......@@ -146,6 +147,7 @@ class AssetLocalTest(AssetBaseTest):
def __init__(self):
def test_local_list(self):
exit_code, outputs ="list")
......@@ -217,6 +219,38 @@ class AssetLocalTest(AssetBaseTest):
class AssetRemoteTest(AssetBaseTest):
object_map = {}
storage_cls = None
asset_cls = None
def __init__(self):
def test_remote_list(self):
exit_code, output ="list", "--remote"), 0, output)
def test_pull_one(self, obj=None):
obj = obj or self.object_map["pull"]
exit_code, output ="pull", obj, prefix=tmp_prefix), 0, output)
storage = self.storage_cls(tmp_prefix, obj)
return storage
def test_pull_all(self):
exit_code, output ="pull", prefix=tmp_prefix), 0, output)
class OnlineTestMixin:
"""Mixin for using Django's live server"""
......@@ -253,7 +287,7 @@ class OnlineTestCase(LiveServerTestCase, OnlineTestMixin, BaseTest):
class OnlineAssetTestCase(LiveServerTestCase, OnlineTestMixin, AssetBaseTest):
class OnlineAssetTestCase(LiveServerTestCase, OnlineTestMixin, AssetRemoteTest):
"""Test case using django live server for asset related remote tests"""
def setUp(self):
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