Ejemplo n.º 1
0
    def test_should_contain_1337_in_last_row_after_transpose(self):
        cols = 100
        rows = 1
        matrix = Matrix(cols, rows, 1)
        val = 1337
        matrix.set_item(cols - 1, 0, val)

        matrix.transpose()

        self.assertEquals(val, matrix.get_item(0, cols - 1))
Ejemplo n.º 2
0
    def test_should_set_and_get_second_row_of_second_column(self):
        matrix = Matrix(2, 2)
        val = 1
        matrix.set_item(1, 1, val)

        self.assertEquals(val, matrix.get_item(1, 1))
Ejemplo n.º 3
0
    def test_should_set_and_get_first_row_of_first_column(self):
        matrix = Matrix(1, 1)
        val = 1
        matrix.set_item(0, 0, val)

        self.assertEquals(val, matrix.get_item(0, 0))