def testCaseInsensitive(self): self.assertEquals('application/X-Google-protobuf', util.choose_content_type( 'application/x-google-protobuf', ['application/X-Google-protobuf', 'application/json' ]))
def testUseCorrectPreferenceIndex(self): self.assertEquals('application/json', util.choose_content_type( '*/*, text/plain, application/json', ['application/X-Google-protobuf', 'application/json' ]))
def testPreferFirstInList(self): self.assertEquals('application/X-Google-protobuf', util.choose_content_type( '*/*', ['application/X-Google-protobuf', 'application/json' ]))
def testIgnoreUnrequested(self): self.assertEquals('application/json', util.choose_content_type( 'text/plain, application/json, */*', ['application/X-Google-protobuf', 'application/json' ]))