Skip to content

Commit d3d5f0a

Browse files
committed
test python3 policy
1 parent 54f4a88 commit d3d5f0a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

plugins/python3/src/policy.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ mod test {
5050
assert!(policy.is_student_source_file(Path::new("src/some_file.py")));
5151
}
5252

53+
#[test]
54+
fn in_root_is_source_file() {
55+
let policy = Python3StudentFilePolicy::new(PathBuf::from(""));
56+
assert!(policy.is_student_source_file(Path::new("some_file.py")));
57+
}
58+
59+
#[test]
60+
fn in_subdir_is_source_file() {
61+
let policy = Python3StudentFilePolicy::new(PathBuf::from(""));
62+
assert!(policy.is_student_source_file(Path::new("src/some_dir/some_file.py")));
63+
}
64+
5365
#[test]
5466
fn pycache_is_not_source_file() {
5567
let policy = Python3StudentFilePolicy::new(PathBuf::from(""));

0 commit comments

Comments
 (0)