def test_nine_2(self): string_multiplier = "1" row1 = 1 row2 = 2 operation = "-" expected = "\\mathbf{r}_1 - \\mathbf{r}_2 \\to \\mathbf{r}_2" actual = rowop.create_op_string(string_multiplier, row1, row2, operation) self.failUnless(actual == expected)
def test_four(self): string_multiplier = rowop.frac_to_latex(rowop.F(-1, 17)) row1 = 1 row2 = 2 operation = "+" expected = "\\frac{-1}{17}\\mathbf{r}_1 + \\mathbf{r}_2 \\to \\mathbf{r}_2" actual = rowop.create_op_string(string_multiplier, row1, row2, operation) self.failUnless(actual == expected)
def test_two(self): string_multiplier = "" row1 = 2 row2 = 1 operation = "+" expected = "\\mathbf{r}_2 + \\mathbf{r}_1 \\to \\mathbf{r}_1" actual = rowop.create_op_string(string_multiplier, row1, row2, operation) self.failUnless(actual == expected)
def test_eight(self): string_multiplier = rowop.frac_to_latex(rowop.F(-1)) row1 = 1 # row2 is irrelevant here row2 = -1 operation = "scale" expected = "-\\mathbf{r}_1 \\to \\mathbf{r}_1" actual = rowop.create_op_string(string_multiplier, row1, row2, operation) self.failUnless(actual == expected)