test(Device): Add tests for Device flow

This commit is contained in:
Lewin Bormann
2019-06-22 12:17:23 +02:00
parent bfe481c93b
commit 45431d83ff
2 changed files with 156 additions and 13 deletions

View File

@@ -56,6 +56,8 @@ pub enum PollError {
AccessDenied,
/// Indicates that too many attempts failed.
TimedOut,
/// Other type of error.
Other(String)
}
impl fmt::Display for PollError {
@@ -65,6 +67,7 @@ impl fmt::Display for PollError {
PollError::Expired(ref date) => writeln!(f, "Authentication expired at {}", date),
PollError::AccessDenied => "Access denied by user".fmt(f),
PollError::TimedOut => "Timed out waiting for token".fmt(f),
PollError::Other(ref s) => format!("Unknown server error: {}", s).fmt(f)
}
}
}