From ede1a4bcd2ee11cf3d461fed065f8459ff338f3f Mon Sep 17 00:00:00 2001 From: Raphael Cohen Date: Mon, 1 Jul 2024 14:29:50 +0200 Subject: [PATCH] feat: Applies PR review suggestion --- arango/collection.py | 2 -- tests/test_document.py | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arango/collection.py b/arango/collection.py index c03c62b..446200f 100644 --- a/arango/collection.py +++ b/arango/collection.py @@ -637,8 +637,6 @@ def has( ) def response_handler(resp: Response) -> bool: - if resp.error_code == 1202: - return False if resp.status_code == 412: raise DocumentRevisionError(resp, request) if resp.status_code == 404: diff --git a/tests/test_document.py b/tests/test_document.py index 8c755eb..514da2a 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -1554,7 +1554,7 @@ def test_document_has(col, bad_col, docs): with assert_raises(DocumentRevisionError) as err: col.has(doc_input, rev=bad_rev, check_rev=True) - assert err.value.error_code in {412, 1200} + assert err.value.error_code == 412 # Test existing documents with bad revision for doc_input in [ @@ -1564,15 +1564,15 @@ def test_document_has(col, bad_col, docs): ]: with assert_raises(DocumentRevisionError) as err: col.has(doc_input) - assert err.value.error_code in {412, 1200} + assert err.value.error_code == 412 with assert_raises(DocumentRevisionError) as err: col.has(doc_input, rev=bad_rev) - assert err.value.error_code in {412, 1200} + assert err.value.error_code == 412 with assert_raises(DocumentRevisionError) as err: col.has(doc_input, rev=bad_rev, check_rev=True) - assert err.value.error_code in {412, 1200} + assert err.value.error_code == 412 assert doc_input in col assert col.has(doc_input, rev=rev, check_rev=True) is True