def test_build_and_run_shows_error_when_no_file(self, mock_isfile, mock_build_run):
        mock_isfile.return_value = False

        compile_files(self.filename_list, mem_test=False)

        self.assertFalse(mock_build_run.called)
        self.assertEqual(mock_build_run.call_count, 0)
    def test_build_and_run_called_for_all_args(self, mock_isfile, mock_build_run):
        mock_isfile.return_value = True

        compile_files(self.filename_list, mem_test=False)

        self.assertEqual(mock_build_run.call_count, len(self.filename_list))
        mock_build_run.assert_has_calls([call(file) for file in self.filename_list])
Exemple #3
0
    def test_build_and_run_shows_error_when_no_file(self, mock_isfile,
                                                    mock_build_run):
        mock_isfile.return_value = False

        compile_files(self.filename_list, mem_test=False)

        self.assertFalse(mock_build_run.called)
        self.assertEqual(mock_build_run.call_count, 0)
Exemple #4
0
    def test_build_and_run_called_for_all_args(self, mock_isfile,
                                               mock_build_run):
        mock_isfile.return_value = True

        compile_files(self.filename_list, mem_test=False)

        self.assertEqual(mock_build_run.call_count, len(self.filename_list))
        mock_build_run.assert_has_calls(
            [call(file) for file in self.filename_list])
Exemple #5
0
def main():
    args, otherthings, parser = parse_known_args()

    if len(otherthings) > 0:
        compile_files(otherthings, args.memory)
    elif args.update:
        return update()
    elif args.problem:
        return problem()
    else:
        parser.print_usage()
        print('No filename passed')
Exemple #6
0
def main():
    args, otherthings, parser = parse_known_args()

    if len(otherthings) > 0:
        compile_files(otherthings, args.memory)
    elif args.update:
        return update()
    elif args.problem:
        return problem()
    else:
        parser.print_usage()
        print('No filename passed')