aboutsummaryrefslogtreecommitdiff
path: root/tests/test_http.rs
blob: 1389ef698ef4fc6905e66eaf46363ad6842951ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![cfg(feature = "http")]

extern crate serenity;

use serenity::http::AttachmentType;
use std::path::Path;

#[test]
fn test_attachment_type() {
    assert!(match AttachmentType::from(Path::new("./dogs/corgis/kona.png")) {
        AttachmentType::Path(_) => true,
        _ => false,
    });
    assert!(match AttachmentType::from("./cats/copycat.png") {
        AttachmentType::Path(_) => true,
        _ => false,
    });
}