Skip to content

Commit

Permalink
feat: Applies PR review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkheir committed Jul 1, 2024
1 parent efbfe7d commit ede1a4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions arango/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand All @@ -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
Expand Down

0 comments on commit ede1a4b

Please sign in to comment.