From b785f143b120de141c3e817f1576eff46a79f512 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Thu, 9 Jul 2020 09:18:19 +0200 Subject: [PATCH] WIP: Update tickets 39 and 128 --- tests/test_tickets.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/test_tickets.py b/tests/test_tickets.py index 0c4af11..ba30137 100644 --- a/tests/test_tickets.py +++ b/tests/test_tickets.py @@ -584,7 +584,7 @@ def test_ticket_39(): scratch = os.path.realpath(db.get_config().get( "EndToEndTests", "test_tickets.test_ticket_39.scratch")) - assert_true(os.path.isdir(scratch)) + assert os.path.isdir(scratch) testfile = os.path.join(scratch, "test.dat") try: # insert RecordType @@ -595,19 +595,16 @@ def test_ticket_39(): # check if the server can connect to this filesystem f = db.File(path="testfiles/file1", pickup=testfile).insert() - assert_true(f.is_valid()) + assert f.is_valid() f.delete() # make unreadable os.chmod(testfile, 0o000) - try: + with pytest.raises(TransactionError) as te: f = db.File( path="testfiles/file1", pickup=testfile).insert() - except EntityError as e: - assert_equal( - "Insufficient read permission for this file. " - "Please make it readable.", - e.msg) + e = te.value.get_errors()[0] + assert e.msg == "Insufficient read permission for this file. Please make it readable." finally: os.chmod(testfile, 0o600) @@ -625,7 +622,7 @@ def test_ticket_128(): try: db.execute_query(r"FIND 5\#):xw;;-`;BY6~PjsI^*g.$+eY#n.aA9zm") except TransactionError as e: - assert_equal(13, int(e.get_error().code)) + assert 13 == int(e.get_error().code) def test_ticket_123a(): -- GitLab