-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: [#1159] use new tracker api client package in tests
The Tracker API client was extracted into a new package. This removes the duplicate client in tests and starts using the new package.
- Loading branch information
1 parent
a1ded65
commit 99fcbb6
Showing
13 changed files
with
14 additions
and
204 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,9 @@ | ||
use torrust_tracker_api_client::connection_info::ConnectionInfo; | ||
|
||
pub fn connection_with_invalid_token(bind_address: &str) -> ConnectionInfo { | ||
ConnectionInfo::authenticated(bind_address, "invalid token") | ||
} | ||
|
||
pub fn connection_with_no_token(bind_address: &str) -> ConnectionInfo { | ||
ConnectionInfo::anonymous(bind_address) | ||
} | ||
|
||
#[derive(Clone)] | ||
pub struct ConnectionInfo { | ||
pub bind_address: String, | ||
pub api_token: Option<String>, | ||
} | ||
|
||
impl ConnectionInfo { | ||
pub fn authenticated(bind_address: &str, api_token: &str) -> Self { | ||
Self { | ||
bind_address: bind_address.to_string(), | ||
api_token: Some(api_token.to_string()), | ||
} | ||
} | ||
|
||
pub fn anonymous(bind_address: &str) -> Self { | ||
Self { | ||
bind_address: bind_address.to_string(), | ||
api_token: None, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
pub mod asserts; | ||
pub mod client; | ||
pub mod contract; |