diff --git a/tests/test_affiliation.py b/tests/test_affiliation.py index 2b72cca4a0bb4a67b5a8f9490947015cf2d6a370..1234a728919d1e1fa794a68fe33594afc513b83f 100644 --- a/tests/test_affiliation.py +++ b/tests/test_affiliation.py @@ -31,13 +31,14 @@ import pytest from pytest import raises - def assert_equal(a, b): assert a == b + def assert_is_not_none(a): assert a is not None + def setup_module(): f = open(file_path, "w") f.write("hello, world!") diff --git a/tests/test_data_model_leap.py b/tests/test_data_model_leap.py index 6db2f65ed9afd4a111c3aa771c092e37679b9638..c7e12d1ede33b18e1397f807eb6447c5e3681f9d 100644 --- a/tests/test_data_model_leap.py +++ b/tests/test_data_model_leap.py @@ -25,6 +25,8 @@ @author: fitschen """ + + def assert_equal(a, b): assert a == b diff --git a/tests/test_deletion.py b/tests/test_deletion.py index d73659b52c31738e4cf72be14e6c16c26e0e8e09..2b795fd2907802df32ea29efe0100d444be80a47 100755 --- a/tests/test_deletion.py +++ b/tests/test_deletion.py @@ -27,19 +27,21 @@ # A. Schlemmer, 08/2014 +import linkahead as h import pytest + def assert_false(a): assert not a + def assert_true(a): assert a + def assert_equal(a, b): assert a == b -import linkahead as h - def setup_module(): old = h.execute_query("FIND ENTITY WITH ID > 100") diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 8bedd0250a9b256c12edaf6c0155b7eb39c64d4f..2922c49408966375549c8af46c2313f7041893fc 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -1291,7 +1291,8 @@ def test_143_white_space(num): ]: with pytest.raises(TransactionError) as cm: db.execute_query(query) - assert cm.value.msg == f'You typed "{num}". Empty spaces are not allowed in numbers. Did you mean "{num.replace(" ", "")}"?' + assert cm.value.msg == f'You typed "{ + num}". Empty spaces are not allowed in numbers. Did you mean "{num.replace(" ", "")}"?' def test_144(): diff --git a/tests/test_list.py b/tests/test_list.py index f204124a5fb16c0a4565db80901af76679688ff9..a569fd0ccdb3f1b2d09d1de62a1b4775937b2a92 100644 --- a/tests/test_list.py +++ b/tests/test_list.py @@ -28,7 +28,7 @@ import os import linkahead as db from linkahead.exceptions import (TransactionError, - UnqualifiedPropertiesError) + UnqualifiedPropertiesError) from pytest import raises diff --git a/tests/test_manual.py b/tests/test_manual.py index c9a18e18a6b723213dc0d4c72d4667e523021773..0fbe09d7e8e7cc9daf74fc537b3fe1b70b3fa920 100644 --- a/tests/test_manual.py +++ b/tests/test_manual.py @@ -21,25 +21,26 @@ # # ** end header # +import pytest from linkahead import Record, RecordType, Property, Container, File, execute_query def assert_not_equal(a, b): assert a != b + def assert_true(a): assert a + def assert_is_not_none(a): assert a is not None + def assert_equal(a, b): assert a == b -import pytest - - def test_retrieve_shortcuts(): c = Container().retrieve( [Record(1337), Record(1338)], raise_exception_on_error=False) diff --git a/tests/test_name_properties.py b/tests/test_name_properties.py index 3128c9d1fd47405969f20598d60629e32f890f88..b2fff379bb70e297cafc2bbe8b97a85c54516bc7 100644 --- a/tests/test_name_properties.py +++ b/tests/test_name_properties.py @@ -29,12 +29,15 @@ import linkahead as db from pytest import raises, mark + def assert_true(a): assert a + def assert_equal(a, b): assert a == b + def setup_module(): pass diff --git a/tests/test_permissions.py b/tests/test_permissions.py index da4a549085e20cad74028434a78eb729806d58a4..7fffb273fc40bec37202d445c32330d2792188a5 100644 --- a/tests/test_permissions.py +++ b/tests/test_permissions.py @@ -27,23 +27,26 @@ """ from __future__ import absolute_import +from pytest import raises, mark import linkahead as db + def assert_equal(a, b): assert a == b + def assert_is_not_none(a): assert a is not None + def assert_false(a): assert not a + def assert_is_none(a): assert a is None -from pytest import raises, mark - test_user = "test_user" test_role = "test_role" diff --git a/tests/test_records.py b/tests/test_records.py index 82cae22480c94e0f5c7fc451c68e15479bf8081f..a9a08a4593662c95125574bccb94a7510fa071ae 100644 --- a/tests/test_records.py +++ b/tests/test_records.py @@ -29,18 +29,23 @@ from linkahead import Record from linkahead.exceptions import CaosDBException import linkahead as caosdb + def assert_is_not_none(a): assert a is not None + def assert_equal(a, b): assert a == b + def assert_true(a): assert a + def assert_false(a): assert not a + def teardown_function(function): try: caosdb.execute_query("FIND Test*").delete() diff --git a/tests/test_recordtypes.py b/tests/test_recordtypes.py index bc8150a29c9558b197772c4b03791ba6da481bb9..12ef99f9bef969a088cc45f1eed596cfafee72e6 100644 --- a/tests/test_recordtypes.py +++ b/tests/test_recordtypes.py @@ -22,11 +22,11 @@ # ** end header # -import caosdb +import linkahead as caosdb def test_recordtypes(): - + def assert_is_not_none(obj): assert obj is not None @@ -108,7 +108,7 @@ def test_record_types_as_reference_properties(): def assert_true(obj): assert obj is True - + def assert_equal(obj1, obj2): assert obj1 == obj2