Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
e450beee
Commit
e450beee
authored
May 23, 2019
by
Samuel GAIST
Browse files
[test][databaseeditor] Cleaned declaration file retrieval
parent
0d92f17e
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/test/test_databaseeditor.py
View file @
e450beee
...
...
@@ -32,7 +32,6 @@ from PyQt5 import QtCore
from
PyQt5.QtWidgets
import
QComboBox
from
PyQt5.QtWidgets
import
QInputDialog
from
..backend.assetmodel
import
AssetModel
from
..backend.assetmodel
import
AssetType
from
..widgets.databaseeditor
import
DatabaseEditor
from
..widgets.databaseeditor
import
ViewEditor
...
...
@@ -67,11 +66,9 @@ def reference_view_json(request):
@
pytest
.
fixture
()
def
reference_database_json
(
test_prefix
):
asset_model
=
AssetModel
()
asset_model
.
asset_type
=
AssetType
.
DATABASE
asset_model
.
prefix_path
=
test_prefix
with
open
(
asset_model
.
json_path
(
"simple/2"
),
"rt"
)
as
json_file
:
with
open
(
AssetType
.
DATABASE
.
declaration_path
(
test_prefix
,
"simple/2"
),
"rt"
)
as
json_file
:
return
json
.
load
(
json_file
)
...
...
@@ -323,11 +320,9 @@ class TestDatabaseEditor:
"""Test that the database editor works correctly"""
def
test_load_and_dump
(
self
,
qtbot
,
beat_context
,
test_prefix
,
test_database
):
asset_model
=
AssetModel
()
asset_model
.
asset_type
=
AssetType
.
DATABASE
asset_model
.
prefix_path
=
test_prefix
with
open
(
asset_model
.
json_path
(
test_database
),
"rt"
)
as
json_file
:
with
open
(
AssetType
.
DATABASE
.
declaration_path
(
test_prefix
,
test_database
),
"rt"
)
as
json_file
:
json_data
=
json
.
load
(
json_file
)
editor
=
DatabaseEditor
()
editor
.
set_context
(
beat_context
)
...
...
Write
Preview
Supports
Markdown
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