@@ -122,7 +122,7 @@ def test_get_modified_timestamp_missing():
122
122
url = "http://example.com/file"
123
123
responses .add (responses .GET , url , status = 404 )
124
124
timestamp = get_modified_timestamp (url )
125
- assert timestamp is None
125
+ assert timestamp == - 1
126
126
127
127
128
128
def test_write_zip (tmpdir ):
@@ -201,7 +201,17 @@ def test_build_bundles(mock_fetch_all_changesets, mock_write_zip, mock_sync_clou
201
201
"metadata" : {"id" : "collection5" , "bucket" : "bucket5" , "flags" : ["startup" ]},
202
202
"timestamp" : 1720004688000 + 10 ,
203
203
},
204
+ { # collection newly marked as bundled
205
+ "changes" : [{"id" : "record5" }],
206
+ "metadata" : {"id" : "collection6" , "bucket" : "bucket6" , "attachment" : {"bundle" : True }},
207
+ "timestamp" : 1720004688000 + 10 ,
208
+ },
204
209
]
210
+ responses .add (
211
+ responses .GET ,
212
+ f"{ server_url } /attachments/bundles/bucket6--collection6.zip" ,
213
+ status = 404 ,
214
+ )
205
215
206
216
build_bundles (event , context = {})
207
217
@@ -221,7 +231,7 @@ def test_build_bundles(mock_fetch_all_changesets, mock_write_zip, mock_sync_clou
221
231
# Assert the second call (changesets.zip)
222
232
changesets_zip_path , changesets_zip_files = calls [1 ][0 ]
223
233
assert changesets_zip_path == "changesets.zip"
224
- assert len (changesets_zip_files ) == 6
234
+ assert len (changesets_zip_files ) == 7
225
235
assert changesets_zip_files [0 ][0 ] == "bucket0--collection0.json"
226
236
assert changesets_zip_files [1 ][0 ] == "bucket1--collection1.json"
227
237
assert changesets_zip_files [2 ][0 ] == "bucket2--collection2.json"
@@ -247,6 +257,7 @@ def test_build_bundles(mock_fetch_all_changesets, mock_write_zip, mock_sync_clou
247
257
"bucket2--collection2.zip" ,
248
258
"bucket3--collection3.zip" ,
249
259
"bucket5--collection5.zip" ,
260
+ "bucket6--collection6.zip" ,
250
261
],
251
262
)
252
263
0 commit comments