Skip to content

Commit 08ccfa2

Browse files
committed
more mypy validation fixes
1 parent d7d3fe3 commit 08ccfa2

3 files changed

Lines changed: 11 additions & 15 deletions

File tree

tests/QE/test_delta_sync.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ async def test_delta_sync_utf8_strings(
448448
sgw_doc = await cblpytest.sync_gateways[0].get_document(
449449
"travel", "hotel_1", "travel", "hotels"
450450
)
451+
assert sgw_doc is not None, "Document should exist in SGW"
451452
self.mark_test_step("Update docs in SGW/CBL with utf8 strings")
452453
updates = [
453454
DocumentUpdateEntry(
@@ -605,6 +606,7 @@ async def test_delta_sync_enabled_disabled(
605606
sgw_doc = await cblpytest.sync_gateways[0].get_document(
606607
"travel", "hotel_1", "travel", "hotels"
607608
)
609+
assert sgw_doc is not None, "Document should exist in SGW"
608610
await cblpytest.sync_gateways[0].upsert_documents(
609611
"travel",
610612
[
@@ -734,6 +736,7 @@ async def test_delta_sync_enabled_disabled(
734736
sgw_doc = await cblpytest.sync_gateways[0].get_document(
735737
"posts", "post_1", collection="posts"
736738
)
739+
assert sgw_doc is not None, "Document should exist in SGW"
737740
await cblpytest.sync_gateways[0].upsert_documents(
738741
"posts",
739742
[
@@ -1114,6 +1117,7 @@ async def test_delta_sync_larger_than_doc(
11141117
doc = await cblpytest.sync_gateways[0].get_document(
11151118
"travel", "hotel_1", "travel", "hotels"
11161119
)
1120+
assert doc is not None, "Document should exist in SGW"
11171121
current_rev = doc.revid
11181122
large_doc_body = "X" * 2_000_000
11191123
await cblpytest.sync_gateways[0].update_documents(

tests/QE/test_no_conflicts.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,12 @@ async def test_multiple_cbls_updates_concurrently_with_push(
305305
sg_doc = await cblpytest.sync_gateways[0].get_document(
306306
"posts", "post_1000", collection="posts"
307307
)
308+
assert sg_doc is not None, "Document should exist in SGW"
308309
cbl1_doc = await db1.get_document(DocumentEntry("_default.posts", "post_1000"))
309310
cbl2_doc = await db2.get_document(DocumentEntry("_default.posts", "post_1000"))
310311
cbl3_doc = await db3.get_document(DocumentEntry("_default.posts", "post_1000"))
311312
assert (
312-
sg_doc is not None
313-
and cbl1_doc is not None
314-
and cbl2_doc is not None
315-
and cbl3_doc is not None
316-
and sg_doc.body.get("title")
313+
sg_doc.body.get("title")
317314
== cbl1_doc.body.get("title")
318315
== cbl2_doc.body.get("title")
319316
== cbl3_doc.body.get("title")
@@ -501,12 +498,9 @@ async def test_multiple_cbls_updates_concurrently_with_pull(
501498
sg_doc = await cblpytest.sync_gateways[0].get_document(
502499
"posts", "post_1000", collection="posts"
503500
)
501+
assert sg_doc is not None, "Document should exist in SGW"
504502
assert (
505-
sg_doc is not None
506-
and cbl1_doc is not None
507-
and cbl2_doc is not None
508-
and cbl3_doc is not None
509-
and cbl1_doc.body.get("title")
503+
cbl1_doc.body.get("title")
510504
== cbl2_doc.body.get("title")
511505
== cbl3_doc.body.get("title")
512506
== sg_doc.body.get("title")
@@ -550,12 +544,9 @@ async def test_multiple_cbls_updates_concurrently_with_pull(
550544
sg_doc = await cblpytest.sync_gateways[0].get_document(
551545
"posts", "post_1000", collection="posts"
552546
)
547+
assert sg_doc is not None, "Document should exist in SGW"
553548
assert (
554-
sg_doc is not None
555-
and cbl1_doc is not None
556-
and cbl2_doc is not None
557-
and cbl3_doc is not None
558-
and cbl1_doc.body.get("title")
549+
cbl1_doc.body.get("title")
559550
== cbl2_doc.body.get("title")
560551
== cbl3_doc.body.get("title")
561552
== sg_doc.body.get("title")

tests/QE/test_replicator_encryption_hook.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ async def test_delta_sync_with_encryption(
306306
sgw_doc = await cblpytest.sync_gateways[0].get_document(
307307
"travel", "hotel_2", "travel", "hotels"
308308
)
309+
assert sgw_doc is not None, "Document should exist in SGW"
309310
updated_doc_bytes = len(json.dumps(sgw_doc.body).encode("utf-8"))
310311
delta_bytes = bytes_written_after - bytes_written_before
311312
assert delta_bytes < updated_doc_bytes, (

0 commit comments

Comments
 (0)