summaryrefslogtreecommitdiff
path: root/tests/common/mod.rs
blob: ff2eb087bec61732c62a3c19715ebc45ef9ed51e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
extern crate twitch_api;
extern crate hyper;
extern crate futures;
extern crate reqwest;
extern crate url;
extern crate http;

use tokio::runtime::current_thread::Runtime;
use twitch_api::{ClientConfig, TestConfig};
use reqwest::r#async::Response;
use http::response::Builder;

pub const CLIENT_ID: &str = "cfabdegwdoklmawdzdo98xt2fo512y";
pub const CLIENT_SECRET: &str = "nyo51xcdrerl8z9m56w9w6wg";

pub fn test_config() -> (ClientConfig, TestConfig) {
    let test_config = TestConfig::default();
    (ClientConfig {
        test_config: Some(test_config.clone()),
        max_retrys: 0,        
        ..ClientConfig::default()
    }, test_config)
}

pub fn okay_response(data: &'static str) -> Response {

    let response =
        Builder::new()
        .status(200)
        .body(data).unwrap();
    Response::from(response)
}