Esempio n. 1
0
 def test_LKG_list5(self):
     store = [[1, 2, 3, 4, 5, 6], [4, 5, 6, 7, 8, 9]]
     result = outputting.listKeyGen(store)
     correct_result = (np.array([[0, 0], [1, 0], [0, 1], [1, 1], [0, 2], [1, 2], [0, 3], [1, 3], [0, 4], [1, 4], [0, 5], [1, 5]]),
                       1)
     assert (result[0] == correct_result[0]).all()
     assert result[1] == correct_result[1]
Esempio n. 2
0
 def test_LKG_list12(self):
     store = [[1, 2, 3, 4, 5, 6]]
     result = outputting.listKeyGen(store, returnList=True, abridge=True)
     correct_result = (np.array([[0]]), 6)
     assert result[0] == correct_result[0]
     assert result[1] == correct_result[1]
Esempio n. 3
0
 def test_LKG_list11(self):
     store = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16], [17, 18], [19, 20], [21, 22]]
     result = outputting.listKeyGen(store, returnList=True, abridge=True)
     correct_result = (None, 2)
     assert result[0] == correct_result[0]
     assert result[1] == correct_result[1]
Esempio n. 4
0
 def test_LKG_list10(self):
     store = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]
     result = outputting.listKeyGen(store, returnList=True, abridge=True, maxListLen=11)
     correct_result = (np.array([[0], [1]]), 11)
     assert (result[0] == correct_result[0]).all()
     assert result[1] == correct_result[1]
Esempio n. 5
0
 def test_LKG_list8(self):
     store = [[1, 2, 3, 4, 5, 6], [4, 5, 6, 7, 8, 9]]
     result = outputting.listKeyGen(store, returnList=True, abridge=True)
     correct_result = (np.array([[0], [1]]), 6)
     assert (result[0] == correct_result[0]).all()
     assert result[1] == correct_result[1]
Esempio n. 6
0
 def test_LKG_list7(self):
     store = [[1, 2, 3, 4, 5, 6], [4, 5, 6, 7, 8, 9]]
     result = outputting.listKeyGen(store, abridge=True)
     correct_result = (None, None)
     assert result[0] == correct_result[0]
     assert result[1] == correct_result[1]
Esempio n. 7
0
 def test_LKG_list4(self):
     store = [1, 2, 3, 4, 5, 6]
     result = outputting.listKeyGen(store, returnList=True)
     correct_result = (None, 6)
     assert result[0] == correct_result[0]
     assert result[1] == correct_result[1]
Esempio n. 8
0
 def test_LKG_list2(self):
     store = [1, 2, 3, 4, 5, 6]
     result = outputting.listKeyGen(store, maxListLen=10)
     correct_result = (np.array([[0], [1], [2], [3], [4], [5]]), 10)
     assert (result[0] == correct_result[0]).all()
     assert result[1] == correct_result[1]
Esempio n. 9
0
 def test_LKG_empty(self):
     store = []
     result = outputting.listKeyGen(store)
     correct_result = (None, None)
     assert result[0] == correct_result[0]
     assert result[1] == correct_result[1]