Exemplo 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()
Exemplo 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
Exemplo 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)