~divmod-dev/divmod.org/trunk

« back to all changes in this revision

Viewing changes to Mantissa/xmantissa/test/test_website.py

Merge branch again for one last trivial deprecation fix that got missed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
from epsilon import hotfix
3
3
hotfix.require('twisted', 'trial_assertwarns')
4
4
 
5
 
import sha
 
5
from hashlib import sha1
6
6
 
7
7
from zope.interface import implements
8
8
from zope.interface.verify import verifyObject
632
632
                return result
633
633
        self.store.inMemoryPowerUp(SiteRootPlugin(), ISessionlessSiteRootPlugin)
634
634
 
635
 
        resource = wrapper.locateChild(req, segments)
 
635
        wrapper.locateChild(req, segments)
636
636
        self.assertEqual(calledWith, [(req, ("foo", "bar"))])
637
637
 
638
638
 
653
653
                return result
654
654
        self.store.inMemoryPowerUp(SiteRootPlugin(), ISessionlessSiteRootPlugin)
655
655
 
656
 
        resource = wrapper.locateChild(req, segments)
 
656
        wrapper.locateChild(req, segments)
657
657
        self.assertEqual(calledWith, [segments])
658
658
 
659
659
 
1169
1169
        jsDir = FilePath(__file__).parent().parent().child("js")
1170
1170
        modulePath = jsDir.child(module).child("__init__.js")
1171
1171
        moduleContents = modulePath.open().read()
1172
 
        expect = sha.new(moduleContents).hexdigest()
 
1172
        expect = sha1(moduleContents).hexdigest()
1173
1173
        self.assertEqual(page.getJSModuleURL(module),
1174
1174
                         url.child(expect).child(module))
1175
1175