Skip to content

Commit

Permalink
Use newer registration apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Apr 2, 2006
1 parent 957184f commit 9066254
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/test_interfaceutility.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,14 @@ def test_local_utilities(self):
default = traverse(self.rootFolder, "++etc++site/default")
default['foo'] = Foo("local")
foo = default['foo']
cm = default.registrationManager

for name in ('', 'bob'):
registration = UtilityRegistration(name, IInterface, foo)
cname = cm.addRegistration(registration)
registration = traverse(cm, cname)

gout = name and "foo global "+name or "foo global"
self.assertEqual(sm.queryUtility(IInterface, name).foo(), gout)

registration.status = ActiveStatus
sm.registerUtility(foo, IInterface, name)
self.assertEqual(
sm.queryUtility(IInterface, name).foo(), "foo local")

registration.status = InactiveStatus
sm.unregisterUtility(foo, IInterface, name)
self.assertEqual(sm.queryUtility(IInterface, name).foo(), gout)


Expand Down

0 comments on commit 9066254

Please sign in to comment.