Ben Bangert avatar Ben Bangert committed ae31483

Switch to using eq_

Comments (0)

Files changed (1)

tests/test_mimetypes.py

 from nose.plugins.skip import SkipTest
+from nose.tools import eq_
 
 from webhelpers.mimehelper import MIMETypes
 from util import test_environ
 
 def test_register_alias():
     MIMETypes.add_alias('html', 'text/html')
-    assert MIMETypes.aliases['html'] == 'text/html'
+    eq_(MIMETypes.aliases['html'], 'text/html')
     
 def test_usage():
     _check_webob_dependency()
     environ = test_environ()
     environ['PATH_INFO'] = '/test.html'
     m = MIMETypes(environ)
-    assert m.mimetype('html') == 'text/html'
+    eq_(m.mimetype('html'), 'text/html')
 
 def test_root_path():
     _check_webob_dependency()
     environ['PATH_INFO'] = '/'
     environ['HTTP_ACCEPT'] = 'text/html, application/xml'
     m = MIMETypes(environ)
-    assert m.mimetype('text/html') == 'text/html'
+    eq_(m.mimetype('text/html'), 'text/html')
 
-def test_with_extention():
+def test_with_extension():
     _check_webob_dependency()
     environ = test_environ()
     environ['PATH_INFO'] = '/test.xml'
     environ['HTTP_ACCEPT'] = 'text/html, application/xml'
     m = MIMETypes(environ)
-    assert m.mimetype('text/html') == False
-    assert m.mimetype('application/xml') == 'application/xml'
+    eq_(m.mimetype('text/html'), False)
+    eq_(m.mimetype('application/xml'), 'application/xml')
 
 def test_with_unregistered_extention():
     _check_webob_dependency()
     environ['PATH_INFO'] = '/test.iscool'
     environ['HTTP_ACCEPT'] = 'application/xml'
     m = MIMETypes(environ)
-    assert m.mimetype('text/html') == False
-    assert m.mimetype('application/xml') == 'application/xml'
+    eq_(m.mimetype('text/html'), False)
+    eq_(m.mimetype('application/xml'), 'application/xml')
 
 def test_with_no_extention():
     _check_webob_dependency()
     environ['PATH_INFO'] = '/test'
     environ['HTTP_ACCEPT'] = 'application/xml'
     m = MIMETypes(environ)
-    assert m.mimetype('text/html') == False
-    assert m.mimetype('application/xml') == 'application/xml'
+    eq_(m.mimetype('text/html'), False)
+    eq_(m.mimetype('application/xml'), 'application/xml')
     
 def test_with_no_extention_and_no_accept():
     _check_webob_dependency()
     environ = test_environ()
     environ['PATH_INFO'] = '/test'
     m = MIMETypes(environ)
-    assert m.mimetype('html') == 'text/html'
+    eq_(m.mimetype('html'), 'text/html')
 
 def test_with_text_star_accept():
     _check_webob_dependency()
     environ['PATH_INFO'] = '/test.iscool'
     environ['HTTP_ACCEPT'] = 'text/*'
     m = MIMETypes(environ)
-    assert m.mimetype('text/html') == 'text/html'
+    eq_(m.mimetype('text/html'), 'text/html')
 
 def test_with_star_star_accept():
     _check_webob_dependency()
     environ['PATH_INFO'] = '/test.iscool'
     environ['HTTP_ACCEPT'] = '*/*'
     m = MIMETypes(environ)
-    assert m.mimetype('application/xml') == 'application/xml'
+    eq_(m.mimetype('application/xml'), 'application/xml')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.