summaryrefslogtreecommitdiff
path: root/tests/common/mod.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2019-02-03 22:30:15 +0000
committerDavid Blajda <blajda@hotmail.com>2019-02-03 22:30:15 +0000
commit96715ceb58b24ee7220d98e421701daa550f44db (patch)
tree2d00984339efab0549fa07079be623b2a7b634f8 /tests/common/mod.rs
parent0a5892c67fb02e09a621ac8796ac84232935f5c3 (diff)
Add Helix and Kraken scopes. Client Config and allow injecting of responses
Diffstat (limited to 'tests/common/mod.rs')
-rw-r--r--tests/common/mod.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
new file mode 100644
index 0000000..ff2eb08
--- /dev/null
+++ b/tests/common/mod.rs
@@ -0,0 +1,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)
+} \ No newline at end of file