@@ -29,9 +29,9 @@ async def test_get_all_hashes_for_domain(self, test_client: TestClient, test_ses
2929 domain = "test-domain"
3030
3131 # Insert test data
32- hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" )
33- hash2 = ContentHashDb (domain = domain , parent_id = "page-2" , content_hash = "hash2" )
34- hash3 = ContentHashDb (domain = "other-domain" , parent_id = "page-3" , content_hash = "hash3" )
32+ hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" , chunk_count = 5 )
33+ hash2 = ContentHashDb (domain = domain , parent_id = "page-2" , content_hash = "hash2" , chunk_count = 10 )
34+ hash3 = ContentHashDb (domain = "other-domain" , parent_id = "page-3" , content_hash = "hash3" , chunk_count = 15 )
3535 test_session .add_all ([hash1 , hash2 , hash3 ])
3636 await test_session .commit ()
3737
@@ -52,9 +52,9 @@ async def test_get_specific_hashes(self, test_client: TestClient, test_session:
5252 domain = "test-domain"
5353
5454 # Insert test data
55- hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" )
56- hash2 = ContentHashDb (domain = domain , parent_id = "page-2" , content_hash = "hash2" )
57- hash3 = ContentHashDb (domain = domain , parent_id = "page-3" , content_hash = "hash3" )
55+ hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" , chunk_count = 5 )
56+ hash2 = ContentHashDb (domain = domain , parent_id = "page-2" , content_hash = "hash2" , chunk_count = 10 )
57+ hash3 = ContentHashDb (domain = domain , parent_id = "page-3" , content_hash = "hash3" , chunk_count = 15 )
5858 test_session .add_all ([hash1 , hash2 , hash3 ])
5959 await test_session .commit ()
6060
@@ -94,8 +94,8 @@ async def test_upsert_new_hashes(self, test_client: TestClient, test_session: As
9494 f"/content-hash/{ domain } /batch-upsert" ,
9595 json = {
9696 "entries" : [
97- {"parent_id" : "page-1" , "content_hash" : "hash1" },
98- {"parent_id" : "page-2" , "content_hash" : "hash2" },
97+ {"parent_id" : "page-1" , "content_hash" : "hash1" , "chunk_count" : 5 },
98+ {"parent_id" : "page-2" , "content_hash" : "hash2" , "chunk_count" : 10 },
9999 ]
100100 },
101101 )
@@ -119,14 +119,14 @@ async def test_upsert_update_existing_hashes(self, test_client: TestClient, test
119119 domain = "test-domain"
120120
121121 # Insert initial hash
122- initial = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "old-hash" )
122+ initial = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "old-hash" , chunk_count = 5 )
123123 test_session .add (initial )
124124 await test_session .commit ()
125125
126126 # Update with new hash
127127 response = test_client .post (
128128 f"/content-hash/{ domain } /batch-upsert" ,
129- json = {"entries" : [{"parent_id" : "page-1" , "content_hash" : "new-hash" }]},
129+ json = {"entries" : [{"parent_id" : "page-1" , "content_hash" : "new-hash" , "chunk_count" : 10 }]},
130130 )
131131
132132 assert response .status_code == 200
@@ -146,7 +146,7 @@ async def test_upsert_mixed(self, test_client: TestClient, test_session: AsyncSe
146146 domain = "test-domain"
147147
148148 # Insert existing hash
149- existing = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "old-hash" )
149+ existing = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "old-hash" , chunk_count = 5 )
150150 test_session .add (existing )
151151 await test_session .commit ()
152152
@@ -155,8 +155,8 @@ async def test_upsert_mixed(self, test_client: TestClient, test_session: AsyncSe
155155 f"/content-hash/{ domain } /batch-upsert" ,
156156 json = {
157157 "entries" : [
158- {"parent_id" : "page-1" , "content_hash" : "updated-hash" },
159- {"parent_id" : "page-2" , "content_hash" : "new-hash" },
158+ {"parent_id" : "page-1" , "content_hash" : "updated-hash" , "chunk_count" : 10 },
159+ {"parent_id" : "page-2" , "content_hash" : "new-hash" , "chunk_count" : 15 },
160160 ]
161161 },
162162 )
@@ -184,9 +184,9 @@ async def test_delete_hashes(self, test_client: TestClient, test_session: AsyncS
184184 domain = "test-domain"
185185
186186 # Insert test hashes
187- hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" )
188- hash2 = ContentHashDb (domain = domain , parent_id = "page-2" , content_hash = "hash2" )
189- hash3 = ContentHashDb (domain = domain , parent_id = "page-3" , content_hash = "hash3" )
187+ hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" , chunk_count = 5 )
188+ hash2 = ContentHashDb (domain = domain , parent_id = "page-2" , content_hash = "hash2" , chunk_count = 10 )
189+ hash3 = ContentHashDb (domain = domain , parent_id = "page-3" , content_hash = "hash3" , chunk_count = 15 )
190190 test_session .add_all ([hash1 , hash2 , hash3 ])
191191 await test_session .commit ()
192192
@@ -215,7 +215,7 @@ async def test_delete_empty_list(self, test_client: TestClient, test_session: As
215215 domain = "test-domain"
216216
217217 # Insert test hash
218- hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" )
218+ hash1 = ContentHashDb (domain = domain , parent_id = "page-1" , content_hash = "hash1" , chunk_count = 5 )
219219 test_session .add (hash1 )
220220 await test_session .commit ()
221221
0 commit comments