github.com/aliyun/aliyun-oss-go-sdk@v3.0.2+incompatible/oss/mime_test.go (about)

     1  package oss
     2  
     3  import (
     4  	. "gopkg.in/check.v1"
     5  )
     6  
     7  type OssMimeSuite struct{}
     8  
     9  var _ = Suite(&OssMimeSuite{})
    10  
    11  func (s *OssMimeSuite) TestTypeByExtension(c *C) {
    12  	filePath := "demo.html"
    13  	typ := TypeByExtension(filePath)
    14  	c.Assert(typ, Equals, "text/html")
    15  
    16  	filePath = "demo.htm"
    17  	typ = TypeByExtension(filePath)
    18  	c.Assert(typ, Equals, "text/html")
    19  
    20  	filePath = "demo.txt"
    21  	typ = TypeByExtension(filePath)
    22  	c.Assert(typ, Equals, "text/plain")
    23  	/*
    24  		filePath = "demo.group"
    25  		typ = TypeByExtension(filePath)
    26  		c.Assert(typ, Equals, "text/x-ms-group")
    27  
    28  		filePath = "demo.htc"
    29  		typ = TypeByExtension(filePath)
    30  		c.Assert(typ, Equals, "text/x-component")
    31  
    32  		filePath = "demo.xsit"
    33  		typ = TypeByExtension(filePath)
    34  		c.Assert(typ, Equals, "text/xml")
    35  
    36  		filePath = "demo.css"
    37  		typ = TypeByExtension(filePath)
    38  		c.Assert(typ, Equals, "text/css")
    39  
    40  		filePath = "demo.rtx"
    41  		typ = TypeByExtension(filePath)
    42  		c.Assert(typ, Equals, "text/richtext")
    43  
    44  		filePath = "demo.tsv"
    45  		typ = TypeByExtension(filePath)
    46  		c.Assert(typ, Equals, "text/tab-separated-values")
    47  
    48  		filePath = "demo.jad"
    49  		typ = TypeByExtension(filePath)
    50  		c.Assert(typ, Equals, "text/vnd.sun.j2me.app-descriptor")
    51  
    52  		filePath = "demo.wml"
    53  		typ = TypeByExtension(filePath)
    54  		c.Assert(typ, Equals, "text/vnd.wap.wml")
    55  
    56  		filePath = "demo.wmls"
    57  		typ = TypeByExtension(filePath)
    58  		c.Assert(typ, Equals, "text/vnd.wap.wmlscript")
    59  
    60  		filePath = "demo.etx"
    61  		typ = TypeByExtension(filePath)
    62  		c.Assert(typ, Equals, "text/x-setext")
    63  
    64  		filePath = "demo.ics"
    65  		typ = TypeByExtension(filePath)
    66  		c.Assert(typ, Equals, "text/calendar")
    67  
    68  		filePath = "demo.ifb"
    69  		typ = TypeByExtension(filePath)
    70  		c.Assert(typ, Equals, "text/calendar")
    71  	*/
    72  }