예제 #1
0
def test_with_no_extention():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test'
    environ['HTTP_ACCEPT'] = 'application/xml'
    m = MIMETypes(environ)
    eq_(m.mimetype('text/html'), False)
    eq_(m.mimetype('application/xml'), 'application/xml')
예제 #2
0
def test_with_no_extention():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test'
    environ['HTTP_ACCEPT'] = 'application/xml'
    m = MIMETypes(environ)
    eq_(m.mimetype('text/html'), False)
    eq_(m.mimetype('application/xml'), 'application/xml')
예제 #3
0
def test_with_star_star_accept():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test.iscool'
    environ['HTTP_ACCEPT'] = '*/*'
    m = MIMETypes(environ)
    eq_(m.mimetype('application/xml'), 'application/xml')
예제 #4
0
def test_with_text_star_accept():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test.iscool'
    environ['HTTP_ACCEPT'] = 'text/*'
    m = MIMETypes(environ)
    eq_(m.mimetype('text/html'), 'text/html')
예제 #5
0
def test_root_path():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/'
    environ['HTTP_ACCEPT'] = 'text/html, application/xml'
    m = MIMETypes(environ)
    eq_(m.mimetype('text/html'), 'text/html')
예제 #6
0
def test_with_star_star_accept():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test.iscool'
    environ['HTTP_ACCEPT'] = '*/*'
    m = MIMETypes(environ)
    eq_(m.mimetype('application/xml'), 'application/xml')
예제 #7
0
def test_with_text_star_accept():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test.iscool'
    environ['HTTP_ACCEPT'] = 'text/*'
    m = MIMETypes(environ)
    eq_(m.mimetype('text/html'), 'text/html')
예제 #8
0
def test_root_path():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/'
    environ['HTTP_ACCEPT'] = 'text/html, application/xml'
    m = MIMETypes(environ)
    eq_(m.mimetype('text/html'), 'text/html')
예제 #9
0
def test_with_no_extention_and_no_accept():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test'
    m = MIMETypes(environ)
    eq_(m.mimetype('html'), 'text/html')
예제 #10
0
def test_usage():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test.html'
    m = MIMETypes(environ)
    eq_(m.mimetype('html'), 'text/html')
예제 #11
0
def test_with_no_extention_and_no_accept():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test'
    m = MIMETypes(environ)
    eq_(m.mimetype('html'), 'text/html')
예제 #12
0
def test_usage():
    _check_webob_dependency()
    environ = test_environ()
    environ['PATH_INFO'] = '/test.html'
    m = MIMETypes(environ)
    eq_(m.mimetype('html'), 'text/html')