@@ -1780,6 +1780,8 @@ def test_close_partition_with_slice_range_granularity_concurrent_cursor_from_dat
17801780
17811781
17821782_SHOULD_BE_SYNCED_START = 10
1783+
1784+
17831785@pytest .mark .parametrize (
17841786 "record, should_be_synced" ,
17851787 [
@@ -1853,8 +1855,19 @@ def test_given_state_when_should_be_synced_then_use_cursor_value_to_filter():
18531855 _NO_LOOKBACK_WINDOW ,
18541856 )
18551857
1856- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : state_value - 1 }, stream_name = "test_stream" )) == False
1857- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : state_value }, stream_name = "test_stream" )) == True
1858+ assert (
1859+ cursor .should_be_synced (
1860+ Record (data = {_A_CURSOR_FIELD_KEY : state_value - 1 }, stream_name = "test_stream" )
1861+ )
1862+ == False
1863+ )
1864+ assert (
1865+ cursor .should_be_synced (
1866+ Record (data = {_A_CURSOR_FIELD_KEY : state_value }, stream_name = "test_stream" )
1867+ )
1868+ == True
1869+ )
1870+
18581871
18591872def test_given_partitioned_state_without_slices_nor_start_when_should_be_synced_then_use_zero_value_to_filter ():
18601873 cursor = ConcurrentCursor (
@@ -1874,8 +1887,14 @@ def test_given_partitioned_state_without_slices_nor_start_when_should_be_synced_
18741887 _NO_LOOKBACK_WINDOW ,
18751888 )
18761889
1877- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : - 1 }, stream_name = "test_stream" )) == False
1878- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : 0 }, stream_name = "test_stream" )) == True
1890+ assert (
1891+ cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : - 1 }, stream_name = "test_stream" ))
1892+ == False
1893+ )
1894+ assert (
1895+ cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : 0 }, stream_name = "test_stream" ))
1896+ == True
1897+ )
18791898
18801899
18811900def test_given_partitioned_state_without_slices_but_start_when_should_be_synced_then_use_start_value_to_filter ():
@@ -1896,8 +1915,20 @@ def test_given_partitioned_state_without_slices_but_start_when_should_be_synced_
18961915 _NO_LOOKBACK_WINDOW ,
18971916 )
18981917
1899- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : _SHOULD_BE_SYNCED_START - 1 }, stream_name = "test_stream" )) == False
1900- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : _SHOULD_BE_SYNCED_START }, stream_name = "test_stream" )) == True
1918+ assert (
1919+ cursor .should_be_synced (
1920+ Record (
1921+ data = {_A_CURSOR_FIELD_KEY : _SHOULD_BE_SYNCED_START - 1 }, stream_name = "test_stream"
1922+ )
1923+ )
1924+ == False
1925+ )
1926+ assert (
1927+ cursor .should_be_synced (
1928+ Record (data = {_A_CURSOR_FIELD_KEY : _SHOULD_BE_SYNCED_START }, stream_name = "test_stream" )
1929+ )
1930+ == True
1931+ )
19011932
19021933
19031934def test_given_partitioned_state_with_one_slice_and_most_recent_cursor_value_when_should_be_synced_then_use_most_recent_cursor_value_of_slice_to_filter ():
@@ -1921,8 +1952,20 @@ def test_given_partitioned_state_with_one_slice_and_most_recent_cursor_value_whe
19211952 _NO_LOOKBACK_WINDOW ,
19221953 )
19231954
1924- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : most_recent_cursor_value - 1 }, stream_name = "test_stream" )) == False
1925- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : most_recent_cursor_value }, stream_name = "test_stream" )) == True
1955+ assert (
1956+ cursor .should_be_synced (
1957+ Record (
1958+ data = {_A_CURSOR_FIELD_KEY : most_recent_cursor_value - 1 }, stream_name = "test_stream"
1959+ )
1960+ )
1961+ == False
1962+ )
1963+ assert (
1964+ cursor .should_be_synced (
1965+ Record (data = {_A_CURSOR_FIELD_KEY : most_recent_cursor_value }, stream_name = "test_stream" )
1966+ )
1967+ == True
1968+ )
19261969
19271970
19281971def test_given_partitioned_state_with_one_slice_without_most_recent_cursor_value_when_should_be_synced_then_use_upper_boundary_of_slice_to_filter ():
@@ -1946,8 +1989,18 @@ def test_given_partitioned_state_with_one_slice_without_most_recent_cursor_value
19461989 _NO_LOOKBACK_WINDOW ,
19471990 )
19481991
1949- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : slice_end - 1 }, stream_name = "test_stream" )) == False
1950- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : slice_end }, stream_name = "test_stream" )) == True
1992+ assert (
1993+ cursor .should_be_synced (
1994+ Record (data = {_A_CURSOR_FIELD_KEY : slice_end - 1 }, stream_name = "test_stream" )
1995+ )
1996+ == False
1997+ )
1998+ assert (
1999+ cursor .should_be_synced (
2000+ Record (data = {_A_CURSOR_FIELD_KEY : slice_end }, stream_name = "test_stream" )
2001+ )
2002+ == True
2003+ )
19512004
19522005
19532006def test_given_partitioned_state_with_multiple_slices_when_should_be_synced_then_use_upper_boundary_of_first_slice_to_filter ():
@@ -1973,8 +2026,23 @@ def test_given_partitioned_state_with_multiple_slices_when_should_be_synced_then
19732026 _NO_LOOKBACK_WINDOW ,
19742027 )
19752028
1976- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : first_slice_end - 1 }, stream_name = "test_stream" )) == False
1977- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : first_slice_end }, stream_name = "test_stream" )) == True
2029+ assert (
2030+ cursor .should_be_synced (
2031+ Record (data = {_A_CURSOR_FIELD_KEY : first_slice_end - 1 }, stream_name = "test_stream" )
2032+ )
2033+ == False
2034+ )
2035+ assert (
2036+ cursor .should_be_synced (
2037+ Record (data = {_A_CURSOR_FIELD_KEY : first_slice_end }, stream_name = "test_stream" )
2038+ )
2039+ == True
2040+ )
19782041 # even if this is within a boundary that has been synced, we don't take any chance and we sync it
19792042 # anyway in most cases, it shouldn't be pulled because we query for specific slice boundaries to the API
1980- assert cursor .should_be_synced (Record (data = {_A_CURSOR_FIELD_KEY : second_slice_start }, stream_name = "test_stream" )) == True
2043+ assert (
2044+ cursor .should_be_synced (
2045+ Record (data = {_A_CURSOR_FIELD_KEY : second_slice_start }, stream_name = "test_stream" )
2046+ )
2047+ == True
2048+ )
0 commit comments