Esempio n. 1
0
 def test_run_command_clear_matrix(self):
     ctx = editor.Context(editor.Matrix)
     ctx.create(3, 4)
     mock_matrix = ctx.instance
     mock_matrix.clear = MagicMock()
     editor.run_command(ctx, 'C')
     mock_matrix.clear.assert_called_with()
Esempio n. 2
0
 def test_run_command_invalid_command(self):
     ctx = editor.Context(editor.Matrix)
     ctx.create(3, 4)
     assert editor.run_command(ctx, 'Z') is None
Esempio n. 3
0
 def test_run_command_create_matrix(self):
     ctx = editor.Context(editor.Matrix)
     ctx.create = MagicMock()
     editor.run_command(ctx, 'I 3 4')
     ctx.create.assert_called_with(3, 4)