Skip to content

Commit d84270b

Browse files
committed
fixed tests
1 parent a10a2e3 commit d84270b

File tree

5 files changed

+8
-39
lines changed

5 files changed

+8
-39
lines changed

tmc-client/src/tmc_client.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -688,25 +688,6 @@ mod test {
688688
assert_eq!(orgs[0].name, "MOOC");
689689
}
690690

691-
#[test]
692-
fn downloads_or_update_exercises() {
693-
let (client, _addr) = init();
694-
let _m = mock("GET", "/api/v8/core/exercises/1234/download")
695-
.match_query(Matcher::AllOf(vec![
696-
Matcher::UrlEncoded("client".into(), "some_client".into()),
697-
Matcher::UrlEncoded("client_version".into(), "some_ver".into()),
698-
]))
699-
.with_body_from_file(Path::new("tests/data/81842.zip"))
700-
.create();
701-
702-
let temp_dir = tempfile::tempdir().unwrap();
703-
let target = temp_dir.path().join("temp");
704-
assert!(!target.exists());
705-
let exercises = vec![(1234, target.clone())];
706-
//client.download_or_update_exercises(exercises).unwrap();
707-
assert!(target.join("src/main/java/Hiekkalaatikko.java").exists());
708-
}
709-
710691
#[test]
711692
fn gets_course_details() {
712693
let (client, _addr) = init();
@@ -1048,8 +1029,8 @@ mod test {
10481029
"points_not_awarded": ["1.3"],
10491030
"url": "ur",
10501031
"update_url": "uu",
1051-
"created_at": "ca",
1052-
"updated_at": "ua",
1032+
"created_at": "2021-03-24T11:31:55+00:00",
1033+
"updated_at": "2021-03-24T11:31:55+00:00",
10531034
}
10541035
])
10551036
.to_string(),

tmc-langs-cli/api/output-data-download-or-update.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@
88
"output-data": {
99
"downloaded": [
1010
{
11+
"id": 1,
1112
"course-slug": "some course",
1213
"exercise-slug": "some exercise",
1314
"path": "some path"
1415
},
1516
{
17+
"id": 2,
1618
"course-slug": "some course",
1719
"exercise-slug": "another exercise",
1820
"path": "another path"
1921
}
2022
],
2123
"skipped": [
2224
{
25+
"id": 3,
2326
"course-slug": "another course",
2427
"exercise-slug": "some skipped exercise",
2528
"path": "third path"

tmc-langs-cli/src/app.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -979,11 +979,6 @@ mod core_test {
979979
]);
980980
}
981981

982-
#[test]
983-
fn download_or_update_exercises() {
984-
get_matches_core(&["download-or-update-exercises", "--exercise", "1234", "path"]);
985-
}
986-
987982
#[test]
988983
fn get_course_data() {
989984
get_matches_core(&["get-course-data", "--course-id", "1234"]);

tmc-langs-cli/src/output.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,20 @@ mod test {
195195
DownloadOrUpdateCourseExercisesResult {
196196
downloaded: vec![
197197
ExerciseDownload {
198+
id: 1,
198199
course_slug: "some course".to_string(),
199200
exercise_slug: "some exercise".to_string(),
200201
path: PathBuf::from("some path"),
201202
},
202203
ExerciseDownload {
204+
id: 2,
203205
course_slug: "some course".to_string(),
204206
exercise_slug: "another exercise".to_string(),
205207
path: PathBuf::from("another path"),
206208
},
207209
],
208210
skipped: vec![ExerciseDownload {
211+
id: 3,
209212
course_slug: "another course".to_string(),
210213
exercise_slug: "some skipped exercise".to_string(),
211214
path: PathBuf::from("third path"),

tmc-langs/src/lib.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -881,16 +881,3 @@ fn extract_project_overwrite(
881881
)?;
882882
Ok(())
883883
}
884-
885-
#[cfg(test)]
886-
#[ignore = "accesses the real TMC server"]
887-
mod server_test {
888-
use super::*;
889-
890-
fn init() {
891-
use log::*;
892-
use simple_logger::*;
893-
894-
let _ = SimpleLogger::new().with_level(LevelFilter::Debug).init();
895-
}
896-
}

0 commit comments

Comments
 (0)