コード例 #1
0
    def test_gpp_system_command_sent_for_c_file(self, mock_compiler):
        mock_compiler.compile().return_value = 0
        mock_compiler.run().return_value = 0

        build_and_run_file(self.filename_cpp)

        mock_compiler.assert_called_once_with(self.filename_cpp)
        mock_compiler.compile.assert_called_once_with()
        mock_compiler.run.assert_called_once_with()
コード例 #2
0
ファイル: test_builder.py プロジェクト: walexzzy/universal
    def test_both_java_system_commands_sent_for_java_file(self, sys_cmd_mock):
        build_and_run_file(self.filename_java)

        call_order = [
            call(AnyStringContaining(EXECUTABLE_JAVAC)),
            call(AnyStringContaining(EXECUTABLE_JAVA))
        ]
        sys_cmd_mock.assert_has_calls(call_order, any_order=False)
        self.assertEqual(sys_cmd_mock.call_count, 2)
コード例 #3
0
ファイル: test_builder.py プロジェクト: walexzzy/universal
    def test_gpp_system_command_sent_for_c_file(self, mock_compiler):
        mock_compiler.compile().return_value = 0
        mock_compiler.run().return_value = 0

        build_and_run_file(self.filename_cpp)

        mock_compiler.assert_called_once_with(self.filename_cpp)
        mock_compiler.compile.assert_called_once_with()
        mock_compiler.run.assert_called_once_with()
コード例 #4
0
    def test_both_java_system_commands_sent_for_java_file(self, sys_cmd_mock):
        build_and_run_file(self.filename_java)

        call_order = [call(AnyStringContaining(EXECUTABLE_JAVAC)), call(AnyStringContaining(EXECUTABLE_JAVA))]
        sys_cmd_mock.assert_has_calls(call_order, any_order=False)
        self.assertEqual(sys_cmd_mock.call_count, 2)
コード例 #5
0
    def test_python_system_command_sent_for_py_file(self, sys_cmd_mock):
        build_and_run_file(self.filename_py)

        sys_cmd_mock.assert_called_once_with(AnyStringContaining(EXECUTABLE_PYTHON))
コード例 #6
0
ファイル: test_builder.py プロジェクト: walexzzy/universal
    def test_python_system_command_sent_for_py_file(self, sys_cmd_mock):
        build_and_run_file(self.filename_py)

        sys_cmd_mock.assert_called_once_with(
            AnyStringContaining(EXECUTABLE_PYTHON))