test/embulk/input/test_mixpanel.rb in embulk-input-mixpanel-0.5.3 vs test/embulk/input/test_mixpanel.rb in embulk-input-mixpanel-0.5.4
- old
+ new
@@ -312,9 +312,16 @@
mock(Mixpanel).resume(transaction_task(days), columns, 1, &control)
Mixpanel.transaction(transaction_config(days), &control)
end
+ def test_next_to_date
+ next_config_diff = Mixpanel.resume(transaction_task(1).merge(incremental: true), columns, 1) do
+ [{to_date: Date.today.to_s, latest_fetched_time: 1502707247000}]
+ end
+ assert_equal(Date.today.to_s, next_config_diff[:from_date])
+ end
+
def test_valid_days_with_backfill
days = 5
stub(Mixpanel).resume() do |task|
assert_equal(["2015-02-17", "2015-02-18", "2015-02-19", "2015-02-20", "2015-02-21", "2015-02-22", "2015-02-23", "2015-02-24", "2015-02-25", "2015-02-26"], task[:dates])