@@ -159,8 +159,7 @@ def test_write_check_quota():
159
159
_version_nums = Mock (find_one_and_update = Mock (return_value = {'version' : 1 })),
160
160
_versions = Mock (insert_one = lambda x : None ),
161
161
_arctic_lib = create_autospec (ArcticLibraryBinding ,
162
- arctic = create_autospec (Arctic , mongo_host = 'some_host' )),
163
- _publish_changes = False )
162
+ arctic = create_autospec (Arctic , mongo_host = 'some_host' )))
164
163
vs ._collection .database .connection .nodes = []
165
164
vs ._write_handler .return_value = write_handler
166
165
VersionStore .write (vs , 'sym' , sentinel .data , prune_previous_version = False )
@@ -367,7 +366,6 @@ def test_write_metadata_with_previous_data():
367
366
assert expected_ret_val == VersionStore .write_metadata (vs , symbol = TEST_SYMBOL , metadata = META_TO_WRITE )
368
367
assert vs ._versions .insert_one .call_args_list == [call (expected_new_version )]
369
368
assert vs ._versions .delete_one .called is False
370
- assert vs ._publish_change .call_args_list == [call (TEST_SYMBOL , expected_new_version )]
371
369
assert vs .write .called is False
372
370
373
371
@@ -393,7 +391,6 @@ def test_write_empty_metadata():
393
391
assert expected_ret_val == VersionStore .write_metadata (vs , symbol = TEST_SYMBOL , metadata = None )
394
392
assert vs ._versions .insert_one .call_args_list == [call (expected_new_version )]
395
393
assert vs ._versions .delete_one .called is False
396
- assert vs ._publish_change .call_args_list == [call (TEST_SYMBOL , expected_new_version )]
397
394
assert vs .write .called is False
398
395
399
396
@@ -404,7 +401,6 @@ def test_write_metadata_insert_version_dupkeyerror():
404
401
VersionStore .write_metadata (vs , symbol = TEST_SYMBOL , metadata = META_TO_WRITE )
405
402
assert vs ._version_nums .find_one_and_update .call_count == 2
406
403
assert vs ._versions .insert_one .call_count == 2
407
- assert vs ._publish_change .call_count == 1
408
404
409
405
410
406
def test_write_metadata_insert_version_opfailure ():
@@ -414,7 +410,6 @@ def test_write_metadata_insert_version_opfailure():
414
410
VersionStore .write_metadata (vs , symbol = TEST_SYMBOL , metadata = META_TO_WRITE )
415
411
assert vs ._version_nums .find_one_and_update .call_count == 1
416
412
assert vs ._versions .insert_one .call_count == 2
417
- assert vs ._publish_change .call_count == 1
418
413
419
414
420
415
def test_restore_version ():
@@ -455,7 +450,6 @@ def test_restore_version_data_missing_symbol():
455
450
as_of = TPL_VERSION ['version' ], prune_previous_version = True )
456
451
assert vs ._read_metadata .call_args_list == [call (TEST_SYMBOL , as_of = TPL_VERSION ['version' ])]
457
452
assert vs ._versions .insert_one .called is False
458
- assert vs ._publish_change .called is False
459
453
460
454
461
455
def test_restore_last_version ():
@@ -488,8 +482,7 @@ def test_write_error_clean_retry():
488
482
_version_nums = Mock (find_one_and_update = Mock (return_value = {'version' : 1 })),
489
483
_versions = Mock (insert_one = Mock (__name__ = "insert_one" ), find_one = Mock (__name__ = "find_one" )),
490
484
_arctic_lib = create_autospec (ArcticLibraryBinding ,
491
- arctic = create_autospec (Arctic , mongo_host = 'some_host' )),
492
- _publish_changes = False )
485
+ arctic = create_autospec (Arctic , mongo_host = 'some_host' )))
493
486
vs ._insert_version = lambda version : VersionStore ._insert_version (vs , version )
494
487
vs ._collection .database .connection .nodes = []
495
488
vs ._write_handler .return_value = write_handler
@@ -498,7 +491,6 @@ def test_write_error_clean_retry():
498
491
assert vs ._versions .find_one .call_count == 2
499
492
assert write_handler .write .call_count == 2
500
493
assert vs ._versions .insert_one .call_count == 1
501
- assert vs ._publish_change .call_count == 1
502
494
503
495
504
496
def test_write_insert_version_duplicatekey ():
@@ -508,8 +500,7 @@ def test_write_insert_version_duplicatekey():
508
500
_version_nums = Mock (find_one_and_update = Mock (return_value = {'version' : 1 })),
509
501
_versions = Mock (insert_one = Mock (__name__ = "insert_one" ), find_one = Mock (__name__ = "find_one" )),
510
502
_arctic_lib = create_autospec (ArcticLibraryBinding ,
511
- arctic = create_autospec (Arctic , mongo_host = 'some_host' )),
512
- _publish_changes = False )
503
+ arctic = create_autospec (Arctic , mongo_host = 'some_host' )))
513
504
vs ._insert_version = lambda version : VersionStore ._insert_version (vs , version )
514
505
vs ._versions .insert_one .side_effect = [DuplicateKeyError ("dup key error" ), None ]
515
506
vs ._collection .database .connection .nodes = []
@@ -518,7 +509,6 @@ def test_write_insert_version_duplicatekey():
518
509
assert vs ._version_nums .find_one_and_update .call_count == 2
519
510
assert vs ._versions .find_one .call_count == 2
520
511
assert write_handler .write .call_count == 2
521
- assert vs ._publish_change .call_count == 2
522
512
assert vs ._versions .insert_one .call_count == 2
523
513
524
514
@@ -529,8 +519,7 @@ def test_write_insert_version_operror():
529
519
_version_nums = Mock (find_one_and_update = Mock (return_value = {'version' : 1 })),
530
520
_versions = Mock (insert_one = Mock (__name__ = "insert_one" ), find_one = Mock (__name__ = "find_one" )),
531
521
_arctic_lib = create_autospec (ArcticLibraryBinding ,
532
- arctic = create_autospec (Arctic , mongo_host = 'some_host' )),
533
- _publish_changes = False )
522
+ arctic = create_autospec (Arctic , mongo_host = 'some_host' )))
534
523
vs ._insert_version = lambda version : VersionStore ._insert_version (vs , version )
535
524
vs ._versions .insert_one .side_effect = [OperationFailure ("mongo op error" ), None ]
536
525
vs ._collection .database .connection .nodes = []
@@ -540,7 +529,6 @@ def test_write_insert_version_operror():
540
529
assert vs ._versions .find_one .call_count == 1
541
530
assert write_handler .write .call_count == 1
542
531
assert vs ._versions .insert_one .call_count == 2
543
- assert vs ._publish_change .call_count == 1
544
532
545
533
546
534
def test_append_error_clean_retry ():
@@ -553,8 +541,7 @@ def test_append_error_clean_retry():
553
541
_version_nums = Mock (find_one_and_update = Mock (return_value = {'version' : previous_version ['version' ]+ 1 })),
554
542
_versions = Mock (insert_one = Mock (__name__ = "insert_one" ), find_one = Mock (__name__ = "find_one" , return_value = previous_version )),
555
543
_arctic_lib = create_autospec (ArcticLibraryBinding ,
556
- arctic = create_autospec (Arctic , mongo_host = 'some_host' )),
557
- _publish_changes = False )
544
+ arctic = create_autospec (Arctic , mongo_host = 'some_host' )))
558
545
vs ._insert_version = lambda version : VersionStore ._insert_version (vs , version )
559
546
vs ._collection .database .connection .nodes = []
560
547
vs ._read_handler .return_value = read_handler
@@ -563,7 +550,6 @@ def test_append_error_clean_retry():
563
550
assert vs ._versions .find_one .call_count == 2
564
551
assert read_handler .append .call_count == 2
565
552
assert vs ._versions .insert_one .call_count == 1
566
- assert vs ._publish_change .call_count == 1
567
553
568
554
569
555
def test_append_insert_version_duplicatekey ():
@@ -575,8 +561,7 @@ def test_append_insert_version_duplicatekey():
575
561
_version_nums = Mock (find_one_and_update = Mock (return_value = {'version' : previous_version ['version' ]+ 1 })),
576
562
_versions = Mock (insert_one = Mock (__name__ = "insert_one" ), find_one = Mock (__name__ = "find_one" , return_value = previous_version )),
577
563
_arctic_lib = create_autospec (ArcticLibraryBinding ,
578
- arctic = create_autospec (Arctic , mongo_host = 'some_host' )),
579
- _publish_changes = False )
564
+ arctic = create_autospec (Arctic , mongo_host = 'some_host' )))
580
565
vs ._insert_version = lambda version : VersionStore ._insert_version (vs , version )
581
566
vs ._versions .insert_one .side_effect = [DuplicateKeyError ("dup key error" ), None ]
582
567
vs ._collection .database .connection .nodes = []
@@ -586,7 +571,6 @@ def test_append_insert_version_duplicatekey():
586
571
assert vs ._versions .find_one .call_count == 2
587
572
assert read_handler .append .call_count == 2
588
573
assert vs ._versions .insert_one .call_count == 2
589
- assert vs ._publish_change .call_count == 2
590
574
591
575
def test_append_insert_version_operror ():
592
576
read_handler = Mock (append = Mock (__name__ = "" ))
@@ -597,8 +581,7 @@ def test_append_insert_version_operror():
597
581
_version_nums = Mock (find_one_and_update = Mock (return_value = {'version' : previous_version ['version' ]+ 1 })),
598
582
_versions = Mock (insert_one = Mock (__name__ = "insert_one" ), find_one = Mock (__name__ = "find_one" , return_value = previous_version )),
599
583
_arctic_lib = create_autospec (ArcticLibraryBinding ,
600
- arctic = create_autospec (Arctic , mongo_host = 'some_host' )),
601
- _publish_changes = False )
584
+ arctic = create_autospec (Arctic , mongo_host = 'some_host' )))
602
585
vs ._insert_version = lambda version : VersionStore ._insert_version (vs , version )
603
586
vs ._versions .insert_one .side_effect = [OperationFailure ("mongo op error" ), None ]
604
587
vs ._collection .database .connection .nodes = []
@@ -608,4 +591,3 @@ def test_append_insert_version_operror():
608
591
assert vs ._versions .find_one .call_count == 1
609
592
assert read_handler .append .call_count == 1
610
593
assert vs ._versions .insert_one .call_count == 2
611
- assert vs ._publish_change .call_count == 1
0 commit comments