from ..irr import compute_ts, simulate_ts_dist
from nose.tools import assert_almost_equal

import numpy as np
#from numpy.testing import (assert_array_equal,
#                           assert_almost_equal)


R = 10
Ns = 35

np.random.seed(42)
res =  np.random.binomial(1, .5, (R, Ns))

def test_irr():
    rho_s = compute_ts(res)
    assert_almost_equal(rho_s, 0.51936507)
    #res = spt(group, condition, response, iterations=1000) 
    #res1 = spt(group, condition, response, iterations=1000) 
    #assert_less(res[1], 0.01)
    #assert_almost_equal(res[3], res1[3])

def test_simulate_ts_dist():
    x = simulate_ts_dist(res)
    print x
    

@@ -40,16 +40,17 @@
 ts_dist%0A
+#
 from nos
@@ -104,17 +104,16 @@
 y as np%0A
-#
 from num
@@ -131,16 +131,57 @@
 import (
+assert_equal,%0A                           
 assert_a
@@ -192,17 +192,16 @@
 _equal,%0A
-#
         
@@ -641,45 +641,227 @@
     
-x = simulate_ts_dist(res)%0A    print x
+expected_res1 = %7B'dist': None,%0A                    'geq': 615,%0A                    'obs_ts': 0.51936507936507936,%0A                    'iter': 10000%7D%0A    res1 = simulate_ts_dist(res)%0A    assert_equal(res1, expected_res1)
 %0A   

Add test for simulate_ts_dist