chore: cleaning code
This commit is contained in:
@@ -41,5 +41,4 @@ mod pull_tests {
|
||||
client.clean();
|
||||
server.clean();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
use std::str;
|
||||
use std::process::{Command, Output};
|
||||
use std::fs::{self, File};
|
||||
use std::io::{Write, BufReader, BufRead};
|
||||
use std::io::Write;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use super::files_utils::has_files;
|
||||
|
||||
#[cfg(test)]
|
||||
pub struct ClientTest {
|
||||
user: String, // the nextcloud user
|
||||
volume: String, // temp dir for the test
|
||||
@@ -14,6 +15,7 @@ pub struct ClientTest {
|
||||
exe_path: PathBuf, // absolute path of nextsync executable
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl ClientTest {
|
||||
pub fn new(id: String) -> Self {
|
||||
// create a directory in /tmp with the given id
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use std::io::{BufReader, BufRead, Write};
|
||||
use std::fs::{File};
|
||||
use std::io::{BufReader, BufRead};
|
||||
use std::fs::File;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn has_files(full_path: PathBuf, file: &str, content: &str, test_id: String) -> bool
|
||||
{
|
||||
if !full_path.exists() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::process::Command;
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use std::fs::{self, File, Permissions};
|
||||
use std::io::{BufReader, BufRead, Write};
|
||||
use std::io::Write;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn lines_should_not_contains(lines: Vec<String>, str: &str) {
|
||||
for line in lines {
|
||||
if line.find(str).is_some() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn get_random_test_id() -> String {
|
||||
let mut id: String = rand::thread_rng()
|
||||
.sample_iter(&Alphanumeric)
|
||||
|
||||
Reference in New Issue
Block a user