BlueGit

ict rusty-teams

Files

rusty-teams / crates / chatsvc / src / teams_cdn.rs

teams_cdn.rs

teams_cdn.rs 1.0 KiB Download Raw
1pub const HOST: &str = "statics.teams.cdn.office.net";
2pub const ROOT: &str = "https://statics.teams.cdn.office.net";
3pub const SOUND_BASE_URL: &str = "https://statics.teams.cdn.office.net/evergreen-assets/audio/";
4pub const STICKER_BASE_URL: &str =
5 "https://statics.teams.cdn.office.net/evergreen-assets/stickerassets";
6pub const EMOTICON_BASE_URL: &str = "https://statics.teams.cdn.office.net/evergreen-assets/personal-expressions/v2/assets/emoticons";
7pub const BACKGROUND_CATALOG_URL: &str =
8 "https://statics.teams.cdn.office.net/evergreen-assets/backgroundimages/config.json?v=7";
9
10#[cfg(test)]
11mod tests {
12 use super::*;
13
14 #[test]
15 fn every_url_lives_on_the_cdn_root() {
16 assert_eq!(ROOT, format!("https://{HOST}"));
17 for url in [
18 SOUND_BASE_URL,
19 STICKER_BASE_URL,
20 EMOTICON_BASE_URL,
21 BACKGROUND_CATALOG_URL,
22 ] {
23 assert!(
24 url.starts_with(&format!("{ROOT}/evergreen-assets/")),
25 "{url}"
26 );
27 }
28 }
29}