Skip to content

Commit

Permalink
update existing tests to use newer session format
Browse files Browse the repository at this point in the history
  • Loading branch information
ducaale committed Jun 3, 2023
1 parent a17c9fb commit ba6edc4
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,9 @@ fn anonymous_sessions() {
},
"auth": { "type": "basic", "raw_auth": "me:pass" },
"cookies": { "cook1": { "value": "one" } },
"headers": [ {"name": "hello", "value": "world"} ]
"headers": [
{ "name": "hello", "value": "world" }
]
})
);
}
Expand All @@ -2121,7 +2123,9 @@ fn anonymous_read_only_session() {
"__meta__": { "about": "xh session file", "xh": "0.0.0" },
"auth": { "type": null, "raw_auth": null },
"cookies": { "cookie1": { "value": "one" } },
"headers": { "hello": "world" }
"headers": [
{ "name": "hello", "value": "world" }
]
});

std::fs::write(&session_file, old_session_content.to_string()).unwrap();
Expand Down Expand Up @@ -2182,7 +2186,7 @@ fn session_files_are_created_in_read_only_mode() {
"lang": { "value": "ar" }
},
"headers": [
{"name": "hello", "value": "world"}
{ "name": "hello", "value": "world" }
]
})
);
Expand Down Expand Up @@ -2215,9 +2219,9 @@ fn named_read_only_session() {
"cookies": {
"cookie1": { "value": "one" }
},
"headers": {
"hello": "world"
}
"headers": [
{ "name": "hello", "value": "world" }
]
});
fs::create_dir_all(path_to_session.parent().unwrap()).unwrap();
File::create(&path_to_session).unwrap();
Expand Down Expand Up @@ -2268,7 +2272,7 @@ fn expired_cookies_are_removed_from_session() {
"value": "random_string",
}
},
"headers": {}
"headers": []
})
.to_string(),
)
Expand Down Expand Up @@ -2336,7 +2340,7 @@ fn cookies_override_each_other_in_the_correct_order() {
"lang": { "value": "fr" },
"cook2": { "value": "three" }
},
"headers": {}
"headers": []
})
.to_string(),
)
Expand Down Expand Up @@ -2386,7 +2390,7 @@ fn basic_auth_from_session_is_used() {
"__meta__": { "about": "xh session file", "xh": "0.0.0" },
"auth": { "type": "basic", "raw_auth": "user:pass" },
"cookies": {},
"headers": {}
"headers": []
})
.to_string(),
)
Expand Down Expand Up @@ -2418,7 +2422,7 @@ fn bearer_auth_from_session_is_used() {
"__meta__": { "about": "xh session file", "xh": "0.0.0" },
"auth": { "type": "bearer", "raw_auth": "secret-token" },
"cookies": {},
"headers": {}
"headers": []
})
.to_string(),
)
Expand Down Expand Up @@ -2476,7 +2480,7 @@ fn auth_netrc_is_not_persisted_in_session() {
"auth": { "type": null, "raw_auth": null },
"cookies": {},
"headers": [
{"name": "hello", "value": "world"}
{ "name": "hello", "value": "world" }
]
})
);
Expand Down

0 comments on commit ba6edc4

Please sign in to comment.