diff options
| author | KunoiSayami <[email protected]> | 2021-07-13 00:13:44 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2021-07-13 00:13:44 +0800 |
| commit | 29680c6a0ac46684ad6c6712896649f6acff737f (patch) | |
| tree | 9cfc603f103345198bff5e175504c61d2b90908c /src/test.rs | |
| parent | e92521c9143fb41fbb664ac6864e575fd79416b3 (diff) | |
feat(core): Rewritten configure file parserv3.0.0
* feat(core): Support full protect mode
* feat(test): Reduced sleeping time and support new parser
* feat(crate): Bump version
Diffstat (limited to 'src/test.rs')
| -rw-r--r-- | src/test.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/test.rs b/src/test.rs index fee2e0f..68ba29d 100644 --- a/src/test.rs +++ b/src/test.rs @@ -212,7 +212,7 @@ mod core { fn test_91_auth_pass() { lock(&PathBuf::from("test/REPO_USER_ADDED"), 10); // If process is too fast, this function may got Database locked error - sleep(Duration::from_millis(50)); + sleep(Duration::from_millis(10)); let s = test_auth_post(); @@ -309,7 +309,7 @@ mod core { let tmpdir = tempdir::TempDir::new("test").unwrap(); let another_file_path = format!( - "include={}/REPO_SETTING # TEST\ncgit-simple-auth-full-protect=false", + "include={}/REPO_SETTING # TEST\ncgit-simple-auth-protect=part", tmpdir.path().to_str().unwrap() ); write_to_specify_file(&tmpdir.path().join("CFG"), another_file_path.as_bytes()).unwrap(); @@ -321,8 +321,10 @@ mod core { let cfg = Config::load_from_path(tmpdir.path().join("CFG")); - assert!(cfg.check_repo_protect("test")); - assert!(!cfg.query_is_all_protected()); + assert!(cfg.check_repo_protect("test"), "struct: {:#?}", cfg); + assert!(!cfg.get_white_list_mode_status()); + // TODO: + //assert!(!cfg.query_is_all_protected()); write_to_specify_file( &tmpdir.path().join("REPO_SETTING"), @@ -333,7 +335,9 @@ mod core { let cfg = Config::load_from_path(tmpdir.path().join("CFG")); assert!(!cfg.check_repo_protect("test")); - assert!(!cfg.query_is_all_protected()); + assert!(!cfg.get_white_list_mode_status()); + // TODO: + //assert!(!cfg.query_is_all_protected()); tmpdir.close().unwrap(); } |
