From 43ee382095b4c4e652a0810331e0e69a08b7922b Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Wed, 27 Mar 2019 19:15:06 -0400 Subject: [PATCH] [DEBUG] avoid get_version call to test failure cause --- tests/test_magpie_api.py | 10 ++++++++-- tests/test_magpie_ui.py | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_magpie_api.py b/tests/test_magpie_api.py index cf051e22e..834f11351 100644 --- a/tests/test_magpie_api.py +++ b/tests/test_magpie_api.py @@ -32,7 +32,9 @@ class TestCase_MagpieAPI_NoAuth_Local(ti.Interface_MagpieAPI_NoAuth, unittest.Te def setUpClass(cls): cls.app = utils.get_test_magpie_app() cls.json_headers = utils.get_headers(cls.app, {'Accept': JSON_TYPE, 'Content-Type': JSON_TYPE}) + # FIXME: use get_version() cls.version = __meta__.__version__ + #cls.version = utils.TestSetup.get_Version(cls) cls.cookies = None cls.usr = get_constant('MAGPIE_ANONYMOUS_USER') cls.grp = get_constant('MAGPIE_ANONYMOUS_GROUP') @@ -71,7 +73,9 @@ def setUpClass(cls): cls.pwd = get_constant('MAGPIE_TEST_ADMIN_PASSWORD') cls.json_headers = utils.get_headers(cls.app, {'Accept': JSON_TYPE, 'Content-Type': JSON_TYPE}) cls.cookies = None - cls.version = utils.TestSetup.get_Version(cls) + # FIXME: use get_version() + cls.version = __meta__.__version__ + #cls.version = utils.TestSetup.get_Version(cls) # TODO: fix UI views so that they can be 'found' directly in the WebTest.TestApp # NOTE: localhost magpie has to be running for following login call to work cls.headers, cls.cookies = utils.check_or_try_login_user(cls.app, cls.usr, cls.pwd, @@ -98,7 +102,9 @@ def setUpClass(cls): cls.cookies = None cls.usr = get_constant('MAGPIE_ANONYMOUS_USER') cls.grp = get_constant('MAGPIE_ANONYMOUS_GROUP') - cls.version = utils.TestSetup.get_Version(cls) + # FIXME: use get_version() + cls.version = __meta__.__version__ + #cls.version = utils.TestSetup.get_Version(cls) @runner.MAGPIE_TEST_API diff --git a/tests/test_magpie_ui.py b/tests/test_magpie_ui.py index 2717177cc..dae5af818 100644 --- a/tests/test_magpie_ui.py +++ b/tests/test_magpie_ui.py @@ -8,13 +8,14 @@ Tests for `magpie.ui` module. """ -import unittest +from magpie import __meta__ from magpie.common import JSON_TYPE from magpie.constants import get_constant from tests import utils, runner # NOTE: must be imported without 'from', otherwise the interface's test cases are also executed import tests.interfaces as ti +import unittest @runner.MAGPIE_TEST_UI @@ -58,7 +59,9 @@ def setUpClass(cls): cls.url = cls.app # to simplify calls of TestSetup (all use .url) cls.json_headers = utils.get_headers(cls.app, {'Accept': JSON_TYPE, 'Content-Type': JSON_TYPE}) cls.cookies = None - cls.version = utils.TestSetup.get_Version(cls) + # FIXME: use get_version() + cls.version = __meta__.__version__ + # cls.version = utils.TestSetup.get_Version(cls) cls.headers, cls.cookies = utils.check_or_try_login_user(cls.url, cls.usr, cls.pwd, use_ui_form_submit=True) cls.require = "cannot run tests without logged in user with '{}' permissions".format(cls.grp) cls.check_requirements()