def test_inverse_dic(self):
        to_test = (["A", "B"], ["C", "D"])

        matrix = Matrix(to_test)

        self.assertEqual(matrix.coords("A"), (0, 0))
        self.assertEqual(matrix.coords("B"), (0, 1))
        self.assertEqual(matrix.coords("C"), (1, 0))
        self.assertEqual(matrix.coords("D"), (1, 1))

        self.assertEqual(matrix.letter((0, 0)), "A")
        self.assertEqual(matrix.letter((0, 1)), "B")
        self.assertEqual(matrix.letter((1, 0)), "C")
        self.assertEqual(matrix.letter((1, 1)), "D")
Beispiel #2
0
 def setUp(self):
     self.matrix = Matrix([])
Beispiel #3
0
 def __init__(self, letters, encoders, decoders):
     self.encoders = encoders
     self.decoders = decoders
     self.matrix = Matrix(letters)
 def setUp(self):
     self.matrix = Matrix([
         ["B", "S", "W"],
         ["A", "R", "P"],
         ["O", "G", "L"],
     ])
 def setUp(self):
     self.matrix = Matrix([
         ["B", "S"],
         ["A", "R"],
         ["K", "P"],
     ])
 def setUp(self):
     self.matrix = Matrix([
         ["B", "S", "V"],
         ["A", "R", "D"]
     ])