class TestMimeTypeMixin(TestCase):
    def setUp(self):
        self.mixin = MimeTypeMixin()

    def _parse_mime_type(self, type):
        return "application/vnd.github.%s.%s+json" % (MimeTypeMixin.VERSION, type)

    def test_header(self):
        self.assertEquals(self.mixin.mime_header(), None)

    def test_add_mimetypes(self):
        self.mixin.add_raw()
        self.mixin.add_text()
        self.mixin.add_html()
        self.mixin.add_full()
        self.assertEquals(
            sorted(self.mixin.mime_header()),
            sorted(
                {
                    "Accept": "%s, %s, %s, %s"
                    % (
                        self._parse_mime_type("raw"),
                        self._parse_mime_type("text"),
                        self._parse_mime_type("html"),
                        self._parse_mime_type("full"),
                    )
                }
            ),
        )
 def setUp(self):
     self.mixin = MimeTypeMixin()