You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
752 B
Rust
32 lines
752 B
Rust
3 years ago
|
use super::super::common;
|
||
|
use hydrus_api::wrapper::address::{Address, DomainCookie};
|
||
|
use std::time::{Duration, SystemTime};
|
||
|
|
||
|
fn get_address() -> Address {
|
||
|
let hydrus = common::get_hydrus();
|
||
|
|
||
|
hydrus.address("trivernis.net/some/path")
|
||
|
}
|
||
|
|
||
|
#[tokio::test]
|
||
|
async fn it_sets_cookies() {
|
||
|
let address = get_address();
|
||
|
address
|
||
|
.set_cookies(vec![
|
||
|
DomainCookie::new("name", "value", None),
|
||
|
DomainCookie::new(
|
||
|
"name2",
|
||
|
"value2",
|
||
|
Some(SystemTime::now() + Duration::from_secs(30)),
|
||
|
),
|
||
|
])
|
||
|
.await
|
||
|
.unwrap();
|
||
|
}
|
||
|
|
||
|
#[tokio::test]
|
||
|
async fn it_retrieves_cookies() {
|
||
|
let address = get_address();
|
||
|
address.get_cookies().await.unwrap();
|
||
|
}
|