コード例 #1
0
 def test_build_pred_1 (self):
     r = StringIO.StringIO("3 2 1 5\n2 2 5 3\n4 1 3\n5 1 1\n")
     tk = 5
     rl = 4
     out = build_pred(r, tk, rl)
     self.assert_(out == [[], [], [5, 3], [1, 5], [3], [1]])
コード例 #2
0
 def test_build_pred_2 (self):
     r = StringIO.StringIO("2 1 1\n3 1 2\n")
     tk = 3
     rl = 2
     out = build_pred(r, tk, rl)
     self.assert_(out == [[], [], [1], [2]])
コード例 #3
0
 def test_build_pred_3 (self):
     r = StringIO.StringIO("2 1 1\n4 3 3 1 2\n5 1 4\n")
     tk = 5
     rl = 3
     out = build_pred(r, tk, rl)
     self.assert_(out == [[], [], [1], [], [3, 1, 2], [4]])