def test_streamingdifftracker_offset_new(): added = [] tracker = StreamingDiffTracker(added.append, 5) tracker.push_new(['b', 'c', 'd', 'e']) tracker.push_old(['a', 'b', 'c']) tracker.done() assert added == ['d', 'e']
def test_streamingdifftracker_offset_new(): added = [] tracker = StreamingDiffTracker(added.append, 5) tracker.push_new(["b", "c", "d", "e"]) tracker.push_old(["a", "b", "c"]) tracker.done() assert added == ["d", "e"]
def test_streamingdifftracker_same_streams(): added = [] tracker = StreamingDiffTracker(added.append, 3) tracker.push_new(['a', 'b', 'c']) tracker.push_old(['a', 'b', 'c']) tracker.done() assert added == []
def test_streamingdifftracker_basic(): added = [] tracker = StreamingDiffTracker(added.append, 3) tracker.push_new(["a", "b", "c"]) tracker.push_old(["b"]) tracker.done() assert added == ["a", "c"]
def test_streamingdifftracker_more_new(): added = [] tracker = StreamingDiffTracker(added.append, 4) tracker.push_new(['a', 'b', 'c', 'd']) tracker.push_old(['r']) tracker.push_new(['e', 'f', 'r', 'z']) tracker.push_old([]) tracker.done() assert added == ['a', 'b', 'c', 'd', 'e', 'f', 'z']
def test_streamingdifftracker_more_old(): added = [] tracker = StreamingDiffTracker(added.append, 2) tracker.push_new(['c', 'd']) tracker.push_old(['a', 'b']) tracker.push_new([]) tracker.push_old(['c']) tracker.done() assert added == ['d']
def test_streamingdifftracker_empty_old(): added = [] tracker = StreamingDiffTracker(added.append, 3) tracker.push_new(['a', 'b', 'c']) tracker.push_old([]) tracker.push_new(['f', 'g', 'h']) tracker.push_old([]) tracker.done() assert added == ['a', 'b', 'c', 'f', 'g', 'h']
def test_streamingdifftracker_multiple_calls(): added = [] tracker = StreamingDiffTracker(added.append, 3) tracker.push_new(['a', 'b', 'c']) tracker.push_old(['b', 'd', 'e']) tracker.push_new(['f', 'g', 'h']) tracker.push_old(['g', 'h']) tracker.done() assert added == ['a', 'c', 'f']
def test_streamingdifftracker_more_new(): added = [] tracker = StreamingDiffTracker(added.append, 4) tracker.push_new(["a", "b", "c", "d"]) tracker.push_old(["r"]) tracker.push_new(["e", "f", "r", "z"]) tracker.push_old([]) tracker.done() assert added == ["a", "b", "c", "d", "e", "f", "z"]
def test_streamingdifftracker_more_old(): added = [] tracker = StreamingDiffTracker(added.append, 2) tracker.push_new(["c", "d"]) tracker.push_old(["a", "b"]) tracker.push_new([]) tracker.push_old(["c"]) tracker.done() assert added == ["d"]
def test_streamingdifftracker_empty_old(): added = [] tracker = StreamingDiffTracker(added.append, 3) tracker.push_new(["a", "b", "c"]) tracker.push_old([]) tracker.push_new(["f", "g", "h"]) tracker.push_old([]) tracker.done() assert added == ["a", "b", "c", "f", "g", "h"]
def test_streamingdifftracker_multiple_calls(): added = [] tracker = StreamingDiffTracker(added.append, 3) tracker.push_new(["a", "b", "c"]) tracker.push_old(["b", "d", "e"]) tracker.push_new(["f", "g", "h"]) tracker.push_old(["g", "h"]) tracker.done() assert added == ["a", "c", "f"]