Commit 78c0a1f1 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[test][databases] Add tests for local commands

parent 934e5b0f
Pipeline #30015 passed with stage
in 6 minutes and 16 seconds
......@@ -40,12 +40,36 @@ import nose.tools
import click
from click.testing import CliRunner
from . import platform, disconnected, prefix, tmp_prefix, user, token
from beat.cmdline.scripts import main_cli
from beat.core.test.utils import slow, cleanup, skipif
from beat.core.database import Storage, Database
from beat.backend.python.test.test_database import INTEGERS_DBS
from beat.backend.python.protocoltemplate import Storage as PTStorage
from beat.core.test.utils import slow, cleanup, skipif
from beat.core.database import Storage, Database, get_first_procotol_template
from beat.cmdline.scripts import main_cli
from . import core
from . import platform, disconnected, prefix, tmp_prefix, user, token
class TestDatabaseLocal(core.AssetLocalTest):
storage_cls = Storage
asset_type = "database"
object_map = {
"valid": "integers_db/1",
"invalid": "invalid/1",
"create": "new_database/1",
"new": "new_database/2",
"fork": "forked_database/1",
}
def setup(self):
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 index_integer_db():
......
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