summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-04-26 09:34:34 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-06-20 08:08:31 -0300
commit891806c1d4ffd8a3da6fb2ea6b182a9fd04fd76b (patch)
tree01752f116e65fed28c86de6360127d804ad2be9e
parent33f015b5c94c9900db5f9e7f7296f57e759094c5 (diff)
downloadmullvadvpn-891806c1d4ffd8a3da6fb2ea6b182a9fd04fd76b.tar.xz
mullvadvpn-891806c1d4ffd8a3da6fb2ea6b182a9fd04fd76b.zip
Refactor where external crates are imported
-rw-r--r--mullvad-daemon/tests/common/mod.rs18
-rw-r--r--mullvad-daemon/tests/startup.rs4
2 files changed, 11 insertions, 11 deletions
diff --git a/mullvad-daemon/tests/common/mod.rs b/mullvad-daemon/tests/common/mod.rs
index d5492ced47..448905c5fe 100644
--- a/mullvad-daemon/tests/common/mod.rs
+++ b/mullvad-daemon/tests/common/mod.rs
@@ -4,6 +4,7 @@
extern crate libc;
#[cfg(not(unix))]
extern crate mullvad_ipc_client;
+extern crate os_pipe;
use std::fs::File;
use std::io::{BufRead, BufReader, Write};
@@ -13,7 +14,8 @@ use std::thread;
use std::time::Duration;
use duct;
-use os_pipe::{pipe, PipeReader};
+
+use self::os_pipe::{pipe, PipeReader};
#[cfg(unix)]
pub static DAEMON_EXECUTABLE_PATH: &str = "../target/debug/mullvad-daemon";
@@ -26,9 +28,9 @@ fn prepare_relay_list<T: AsRef<Path>>(path: T) {
if !path.exists() {
File::create(path)
- .expect("failed to create relay list file")
+ .expect("Failed to create relay list file")
.write_all(b"{ \"countries\": [] }")
- .expect("failed to write relay list");
+ .expect("Failed to write relay list");
}
}
@@ -41,7 +43,7 @@ impl DaemonRunner {
pub fn spawn() -> Self {
prepare_relay_list("../dist-assets/relays.json");
- let (reader, writer) = pipe().expect("failed to open pipe to connect to daemon");
+ let (reader, writer) = pipe().expect("Failed to open pipe to connect to daemon");
let process = cmd!(DAEMON_EXECUTABLE_PATH, "-v", "--disable-log-to-file")
.dir("..")
.env("MULLVAD_CACHE_DIR", "./")
@@ -49,7 +51,7 @@ impl DaemonRunner {
.stderr_to_stdout()
.stdout_handle(writer)
.start()
- .expect("failed to start daemon");
+ .expect("Failed to start daemon");
DaemonRunner {
process: Some(process),
@@ -63,7 +65,7 @@ impl DaemonRunner {
thread::spawn(move || {
Self::wait_for_output(stdout, pattern);
- tx.send(()).expect("failed to report search result");
+ tx.send(()).expect("Failed to report search result");
});
rx.recv_timeout(timeout)
@@ -73,7 +75,7 @@ impl DaemonRunner {
fn wait_for_output(output: Arc<Mutex<BufReader<PipeReader>>>, pattern: &str) {
let mut output = output
.lock()
- .expect("another thread panicked while holding a lock to the process output");
+ .expect("Another thread panicked while holding a lock to the process output");
let mut line = String::new();
@@ -81,7 +83,7 @@ impl DaemonRunner {
line.clear();
output
.read_line(&mut line)
- .expect("failed to read line from daemon stdout");
+ .expect("Failed to read line from daemon stdout");
}
}
diff --git a/mullvad-daemon/tests/startup.rs b/mullvad-daemon/tests/startup.rs
index f273ee2ca3..f9bb5d04f6 100644
--- a/mullvad-daemon/tests/startup.rs
+++ b/mullvad-daemon/tests/startup.rs
@@ -2,8 +2,6 @@
extern crate duct;
extern crate mullvad_ipc_client;
extern crate mullvad_paths;
-extern crate os_pipe;
-extern crate talpid_ipc;
mod common;
@@ -36,7 +34,7 @@ fn rpc_info_file_permissions() {
assert!(rpc_file.exists());
ensure_only_admin_can_write(
- fs::metadata(&rpc_file).expect("failed to read RPC address file metadata"),
+ fs::metadata(&rpc_file).expect("Failed to read RPC address file metadata"),
);
}