aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2011-11-30 00:15:25 +0100
committerDavid Medina <davidmedina9@gmail.com>2011-11-30 00:15:25 +0100
commit3547813022e7f5da658e74317ca62849609b5d24 (patch)
treec7ebaa4f3ed0a17f782c52a341aeaf5b4877ab1a
parentFix get_converter to delete converter in kwargs (diff)
downloadpython-github3-3547813022e7f5da658e74317ca62849609b5d24.tar.xz
python-github3-3547813022e7f5da658e74317ca62849609b5d24.zip
Fix mime_header to return None if needed
-rw-r--r--github3/handlers/base.py4
-rw-r--r--github3/tests/handler_test.py3
2 files changed, 6 insertions, 1 deletions
diff --git a/github3/handlers/base.py b/github3/handlers/base.py
index e36a08a..565978f 100644
--- a/github3/handlers/base.py
+++ b/github3/handlers/base.py
@@ -33,7 +33,9 @@ class MimeTypeMixin(object):
return self
def mime_header(self):
- return {'Accept': ', '.join(self.mimetypes)}
+ if self.mimetypes:
+ return {'Accept': ', '.join(self.mimetypes)}
+ return None
class Handler(object):
diff --git a/github3/tests/handler_test.py b/github3/tests/handler_test.py
index 4dbe77a..83c89ef 100644
--- a/github3/tests/handler_test.py
+++ b/github3/tests/handler_test.py
@@ -22,6 +22,9 @@ class TestMimeTypeMixin(TestCase):
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()