|
1 | 1 | """Tests for the MOSS interface package for CodeClassroom""" |
2 | | -from plagcheck import plagcheck |
3 | | -from plagcheck import analyze |
| 2 | +from plagcheck import analyze, plagcheck |
4 | 3 |
|
5 | 4 |
|
6 | 5 | def test_check(): |
7 | 6 | """General test""" |
8 | 7 | language = "python" |
9 | 8 | userid = "1" |
10 | 9 | temp = plagcheck.check(language, userid) |
11 | | - temp.addFilesByWildCard("testfiles/test_python*.py") |
| 10 | + temp.addFile("testfiles/test_python.py") |
| 11 | + temp.addFile("testfiles/test_python2.py") |
12 | 12 | temp.submit() |
13 | 13 | results = temp.getResults() |
14 | 14 | insights = temp.getInsights() |
15 | 15 | share_scores = temp.getShareScores() |
16 | 16 |
|
17 | 17 | assert share_scores == { |
18 | | - "testfiles/test_python.py": 2, |
19 | | - "testfiles/test_python2.py": 2, |
20 | | - "testfiles/test_python3.py": 2, |
| 18 | + "testfiles/test_python.py": 1, |
| 19 | + "testfiles/test_python2.py": 1, |
21 | 20 | } |
22 | 21 |
|
23 | 22 | assert insights == {"DCtoC Paths": [], "DtoC Paths": [], "DtoDC Paths": []} |
24 | 23 |
|
25 | 24 | assert results == [ |
26 | | - { |
27 | | - "file1": "testfiles/test_python2.py", |
28 | | - "file2": "testfiles/test_python3.py", |
29 | | - "lines_matched": [["1-3", "1-3"]], |
30 | | - "no_of_lines_matched": 3, |
31 | | - "percentage_file1": 90, |
32 | | - "percentage_file2": 90, |
33 | | - }, |
34 | | - { |
35 | | - "file1": "testfiles/test_python.py", |
36 | | - "file2": "testfiles/test_python3.py", |
37 | | - "lines_matched": [["1-3", "1-3"]], |
38 | | - "no_of_lines_matched": 3, |
39 | | - "percentage_file1": 90, |
40 | | - "percentage_file2": 90, |
41 | | - }, |
42 | 25 | { |
43 | 26 | "file1": "testfiles/test_python.py", |
44 | 27 | "file2": "testfiles/test_python2.py", |
|
0 commit comments