예제 #1
0
    def test_cloning_without_permissions(self):
        with CaptureOutput() as capture:
            grader_main([sys.argv[0], '-b', 'tests/links.txt', 'self-compile'])

            output = capture.get_loud_output()

        # should not raise an exception and state errors for both repositories
        self.assertIn('cksystemsteaching/selfie: ', output)
        self.assertIn('ChristianMoesl/selfie: ', output)
예제 #2
0
    def test_bulk_grading(self, mock, exit_mock):
        mock.side_effect = self.commit_without_auth

        exit_mock.side_effect = self.exit_mock

        with CaptureOutput() as capture:
            grader_main([sys.argv[0], '-b', 'tests/links.txt', 'self-compile'])

            output = capture.get_loud_output()

        for line in output.split('\n'):
            self.assertTrue(line == ''
                            or re.match('[^/]+/[^/:]+: [1-5]', line) != None)
    def test_path_name_with_whitespaces(self, mock):
        mock.side_effect = self.execute_mock

        copytree('..', dst)

        cwd = getcwd()

        chdir(dst)

        with CaptureOutput(), patch('lib.checks.insert_assignment_path') as assignment_path_mock:
            assignment_path_mock.side_effect = self.insert_assignment_path

            grader_main([getcwd(), 'hex-literal'])

        chdir(cwd)

        rmtree(dst)
예제 #4
0
    def test_path_name_with_whitespaces(self, mock):
        mock.side_effect = self.execute_mock

        copytree('..', dst)

        cwd = getcwd()

        chdir(dst)

        with Console(), patch('lib.runner.insert_home_path') as home_path_mock:
            home_path_mock.side_effect = self.insert_home_path

            grader_main([getcwd(), 'hex-literal'])

        chdir(cwd)

        rmtree(dst)