Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
78c0a1f1
Commit
78c0a1f1
authored
May 08, 2019
by
Samuel GAIST
Browse files
[test][databases] Add tests for local commands
parent
934e5b0f
Pipeline
#30015
passed with stage
in 6 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/test/test_databases.py
View file @
78c0a1f1
...
...
@@ -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
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment