from __future__ import absolute_import
from __future__ import print_function
from datetime import timedelta

from corehq.util.datadog.utils import make_bucket_from_timedeltas, DAY_SCALE_TIME_BUCKETS


def test_make_bucket_from_timedeltas():
    buckets = [1, 10, 60, 10 * 60, 60 * 60, 12 * 60 * 60, 24 * 60 * 60]
    assert make_bucket_from_timedeltas(
        timedelta(seconds=1),
        timedelta(seconds=10),
        timedelta(minutes=1),
        timedelta(minutes=10),
        timedelta(hours=1),
        timedelta(hours=12),
        timedelta(hours=24),
    ) == buckets
    assert DAY_SCALE_TIME_BUCKETS == buckets

@@ -102,16 +102,39 @@
 edelta%0A%0A
+from testil import eq%0A%0A
 from cor
@@ -215,16 +215,16 @@
 BUCKETS%0A
-
 %0A%0Adef te
@@ -333,23 +333,19 @@
 60%5D%0A    
-assert 
+eq(
 make_buc
@@ -578,27 +578,25 @@
 ),%0A    )
- ==
+,
  buckets
 %0A    ass
@@ -591,20 +591,17 @@
 kets
+)
 %0A    
-assert 
+eq(
 DAY_
@@ -622,16 +622,14 @@
 KETS
- ==
+,
  buckets
 %0A
@@ -627,9 +627,10 @@
  buckets
+)
 %0A

Use testil.eq instead of assert == in test_buckets.py