@@ -940,40 +940,40 @@ def test_last_seq_since_none_last_seq_advances_beyond(self):
940940
941941
942942# ---------------------------------------------------------------------------
943- # TestGetLastSeqNewerThan — unit tests for ChangesFollower.get_last_seq_newer_than
943+ # TestLatestSequenceFrom — unit tests for ChangesFollower.latest_sequence_from
944944# ---------------------------------------------------------------------------
945945
946- class TestGetLastSeqNewerThan (ChangesFollowerBaseCase ):
946+ class TestLatestSequenceFrom (ChangesFollowerBaseCase ):
947947
948- def test_get_last_seq_newer_than_with_none (self ):
948+ def test_latest_sequence_from_with_none (self ):
949949 """Raises ValueError when passed None."""
950950 follower = ChangesFollower (self .client , db = 'db' )
951- with self .assertRaisesRegex (ValueError , 'The provided sequence ID cannot be null or empty' ):
952- follower .get_last_seq_newer_than (None )
951+ with self .assertRaisesRegex (ValueError , 'Provided sequence ID must be a non- empty string ' ):
952+ follower .latest_sequence_from (None )
953953
954- def test_get_last_seq_newer_than_with_empty_string (self ):
954+ def test_latest_sequence_from_with_empty_string (self ):
955955 """Raises ValueError when passed an empty string."""
956956 follower = ChangesFollower (self .client , db = 'db' )
957- with self .assertRaisesRegex (ValueError , 'The provided sequence ID cannot be null or empty' ):
958- follower .get_last_seq_newer_than ('' )
957+ with self .assertRaisesRegex (ValueError , 'Provided sequence ID must be a non- empty string ' ):
958+ follower .latest_sequence_from ('' )
959959
960- def test_get_last_seq_newer_than_before_feed_starts (self ):
960+ def test_latest_sequence_from_before_feed_starts (self ):
961961 """Returns the input seq unchanged when the feed has not started yet."""
962962 follower = ChangesFollower (self .client , db = 'db' )
963- self .assertEqual (follower .get_last_seq_newer_than ('seq-a' ), 'seq-a' )
963+ self .assertEqual (follower .latest_sequence_from ('seq-a' ), 'seq-a' )
964964
965965 @responses .activate
966- def test_get_last_seq_newer_than_unknown_seq (self ):
966+ def test_latest_sequence_from_unknown_seq (self ):
967967 """Returns the input seq unchanged when it was never seen by this follower."""
968968 self .prepare_mock_changes (batches = 1 )
969969 follower = ChangesFollower (self .client , db = 'db' )
970970 changes = follower .start_one_off ()
971971 for _ in changes :
972972 pass
973- self .assertEqual (follower .get_last_seq_newer_than ('seq-unknown' ), 'seq-unknown' )
973+ self .assertEqual (follower .latest_sequence_from ('seq-unknown' ), 'seq-unknown' )
974974
975975 @responses .activate
976- def test_get_last_seq_newer_than_middle_of_batch (self ):
976+ def test_latest_sequence_from_middle_of_batch (self ):
977977 """
978978 Returns the input seq unchanged when querying with a seq from the
979979 middle of a batch — only the last item's seq is stored in seq_markers.
@@ -985,18 +985,18 @@ def test_get_last_seq_newer_than_middle_of_batch(self):
985985 # seq-a and seq-b are middle items — not stored in seq_markers
986986 seq_a = items [0 ].seq
987987 seq_b = items [1 ].seq
988- self .assertEqual (follower .get_last_seq_newer_than (seq_a ), seq_a )
989- self .assertEqual (follower .get_last_seq_newer_than (seq_b ), seq_b )
988+ self .assertEqual (follower .latest_sequence_from (seq_a ), seq_a )
989+ self .assertEqual (follower .latest_sequence_from (seq_b ), seq_b )
990990
991991 @responses .activate
992- def test_get_last_seq_newer_than_end_to_end (self ):
992+ def test_latest_sequence_from_end_to_end (self ):
993993 """Returns the correct last_seq through a completed stream."""
994994 self .prepare_mock_changes (batches = 1 )
995995 follower = ChangesFollower (self .client , db = 'db' )
996996 changes = follower .start_one_off ()
997997 items = list (changes )
998998 # Last item's seq should map to the page's last_seq
999999 last_item_seq = items [- 1 ].seq
1000- result = follower .get_last_seq_newer_than (last_item_seq )
1000+ result = follower .latest_sequence_from (last_item_seq )
10011001 # The last item seq IS the last_seq for a normal page (type 1 equivalent)
10021002 self .assertEqual (result , last_item_seq )
0 commit comments