many updates in report code and in storage structure, this commit is broken
diff --git a/tests/test_math.py b/tests/test_math.py
new file mode 100644
index 0000000..5a75858
--- /dev/null
+++ b/tests/test_math.py
@@ -0,0 +1,32 @@
+import numpy
+from wally.statistic import rebin_histogram
+
+
+def array_eq(x: numpy.array, y: numpy.array, max_diff: float = 1E-3) -> bool:
+    return numpy.abs(x - y).max() <= max_diff
+
+
+def test_rebin_histo():
+    curr_histo = numpy.empty((100,), dtype=int)
+    curr_histo[:] = 1
+    edges = numpy.arange(100)
+    new_histo, new_edges = rebin_histogram(curr_histo, edges, 10)
+
+    assert new_edges.shape == (10,)
+    assert new_histo.shape == (10,)
+    assert new_edges.dtype.name.startswith('float')
+    assert new_histo.dtype.name.startswith('int')
+
+    assert array_eq(new_edges, numpy.arange(10) * 9.9)
+    assert new_histo.sum() == curr_histo.sum()
+    assert list(new_histo) == [10] * 10
+
+    new_histo, new_edges = rebin_histogram(curr_histo, edges, 3,
+                                           left_tail_idx=20,
+                                           right_tail_idx=50)
+
+    assert new_edges.shape == (3,)
+    assert new_histo.shape == (3,)
+    assert array_eq(new_edges, numpy.array([20, 30, 40]))
+    assert new_histo.sum() == curr_histo.sum()
+    assert list(new_histo) == [30, 10, 60]
diff --git a/tests/test_rpc.py b/tests/test_rpc.py
index fd35555..db24768 100644
--- a/tests/test_rpc.py
+++ b/tests/test_rpc.py
@@ -7,13 +7,13 @@
 
 
 @contextlib.contextmanager
-def rpc_conn_ctx(uri):
+def rpc_conn_ctx(uri, log_level=None):
     creds = ssh_utils.parse_ssh_uri(uri)
     rpc_code, modules = node.get_rpc_server_code()
 
     ssh_conn = node.connect(node_interfaces.NodeInfo(creds, set()))
     try:
-        rpc_conn = node.setup_rpc(ssh_conn, rpc_code, plugins=modules)
+        rpc_conn = node.setup_rpc(ssh_conn, rpc_code, plugins=modules, log_level=log_level)
         try:
             yield rpc_conn
         finally: