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

[test][databaseeditor] Cleaned declaration file retrieval

parent 0d92f17e
......@@ -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)
......
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