コード例 #1
0
 def test_to_color_result(self):
     editor = EditorGrafico()
     editor.execute_command("I 5 5")
     editor.execute_command("L 2 2 A")
     color = editor.matrix().get(2, 2)
     self.assertEquals(color, "A")
コード例 #2
0
 def test_to_color_few_argments(self):
     editor = EditorGrafico()
     editor.execute_command("I 5 5")
     editor.execute_command("L 1 1")
     self.assertRaises(UserWarning)
コード例 #3
0
 def test_to_color_wrong_column_value(self):
     editor = EditorGrafico()
     editor.execute_command("I 5 5")
     editor.execute_command("L 1 B C")
     self.assertRaises(ValueError)
コード例 #4
0
 def test_to_color_pixel_empty(self):
     editor = EditorGrafico()
     editor.execute_command("L 1 2 A")
     self.assertRaises(UserWarning)
コード例 #5
0
 def test_clear_zeros_matrix(self):
     editor = EditorGrafico()
     editor.execute_command("I 5 5")
     self.assertRaises(UserWarning)
コード例 #6
0
 def test_create_matrix_user_warning_few_arguments(self):
     editor = EditorGrafico()
     editor.execute_command("I 3")
     self.assertRaises(UserWarning)
コード例 #7
0
 def test_create_matrix(self):
     editor = EditorGrafico()
     editor.execute_command("I 5 5")
     matrix = Matrix(5, 5)
     self.assertEquals(editor.matrix(), matrix)
コード例 #8
0
 def test_set_command_true(self):
     editor = EditorGrafico()
     self.assertTrue(editor.execute_command("I 5 5"))