test/embulk/input/test_mixpanel.rb in embulk-input-mixpanel-0.5.4 vs test/embulk/input/test_mixpanel.rb in embulk-input-mixpanel-0.5.5

- old
+ new

@@ -539,10 +539,11 @@ fetch_unknown_columns: false, fetch_custom_properties: false, retry_initial_wait_sec: 0, retry_limit: 3, latest_fetched_time: 0, + slice_range: 7 } end end class RunTest < self @@ -583,10 +584,24 @@ mock(@page_builder).finish @plugin.run end + class SliceRangeRunTest < self + + def test_default_slice_range + plugin = Mixpanel.new(task.merge(slice_range: 2), nil, nil, @page_builder) + stub(plugin).preview? {false} + stub(plugin).fetch(["2015-02-22", "2015-02-23"],0){[]} + stub(plugin).fetch(["2015-02-24", "2015-02-25"],0){[]} + stub(plugin).fetch(["2015-02-26", "2015-02-27"],0){[]} + stub(plugin).fetch(["2015-02-28", "2015-03-01"],0){[]} + mock(@page_builder).finish + plugin.run + end + end + class NonIncrementalRunTest < self def test_non_incremental_run mock(@page_builder).add(anything).times(records.length * 2) @@ -805,9 +820,10 @@ fetch_unknown_columns: false, fetch_custom_properties: false, retry_initial_wait_sec: 2, retry_limit: 3, latest_fetched_time: 0, + slice_range: 7 } end def records [