コード例 #1
0
ファイル: tests.py プロジェクト: hacktoon/image-matrix
 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()
コード例 #2
0
ファイル: tests.py プロジェクト: hacktoon/image-matrix
 def test_run_command_invalid_command(self):
     ctx = editor.Context(editor.Matrix)
     ctx.create(3, 4)
     assert editor.run_command(ctx, 'Z') is None
コード例 #3
0
ファイル: tests.py プロジェクト: hacktoon/image-matrix
 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)