Changeset 54:6548e1eeb7e2 for wokkel/test/test_component.py
- Timestamp:
- Apr 22, 2009, 4:45:04 PM (13 years ago)
- Branch:
- default
- Convert:
- svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@166
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wokkel/test/test_component.py
r41 r54 42 42 43 43 44 def test_startService(self): 45 """ 46 Starting the service creates a new route and hooks up handlers. 47 """ 48 44 45 def test_startServiceRunning(self): 46 """ 47 Starting the service makes it running. 48 """ 49 self.assertFalse(self.component.running) 50 self.component.startService() 51 self.assertTrue(self.component.running) 52 53 54 def test_startServiceAddRoute(self): 55 """ 56 Starting the service creates a new route. 57 """ 58 self.component.startService() 59 self.assertIn('component', self.router.routes) 60 61 62 def test_startServiceNoDomain(self): 63 self.component = component.InternalComponent(self.router) 64 self.component.startService() 65 66 67 def test_startServiceAddMultipleRoutes(self): 68 """ 69 Starting the service creates a new route. 70 """ 71 self.component.domains.add('component2') 72 self.component.startService() 73 self.assertIn('component', self.router.routes) 74 self.assertIn('component2', self.router.routes) 75 76 77 def test_startServiceHandlerDispatch(self): 78 """ 79 Starting the service hooks up handlers. 80 """ 49 81 events = [] 50 82 … … 57 89 TestHandler().setHandlerParent(self.component) 58 90 59 self.assertFalse(self.component.running) 60 61 self.component.startService() 62 63 self.assertTrue(self.component.running) 64 self.assertIn('component', self.router.routes) 65 91 self.component.startService() 66 92 self.assertEquals([], events) 67 93 self.component.xmlstream.dispatch(None, '//event/test') … … 69 95 70 96 71 def test_stopService(self): 72 """ 73 Stopping the service removes the route and disconnects handlers. 74 """ 75 97 def test_stopServiceNotRunning(self): 98 """ 99 Stopping the service makes it not running. 100 """ 101 self.component.startService() 102 self.component.stopService() 103 self.assertFalse(self.component.running) 104 105 106 def test_stopServiceRemoveRoute(self): 107 """ 108 Stopping the service removes routes. 109 """ 110 self.component.startService() 111 self.component.stopService() 112 self.assertNotIn('component', self.router.routes) 113 114 115 def test_stopServiceNoDomain(self): 116 self.component = component.InternalComponent(self.router) 117 self.component.startService() 118 self.component.stopService() 119 120 121 def test_startServiceRemoveMultipleRoutes(self): 122 """ 123 Starting the service creates a new route. 124 """ 125 self.component.domains.add('component2') 126 self.component.startService() 127 self.component.stopService() 128 self.assertNotIn('component', self.router.routes) 129 self.assertNotIn('component2', self.router.routes) 130 131 132 def test_stopServiceHandlerDispatch(self): 133 """ 134 Stopping the service disconnects handlers. 135 """ 76 136 events = [] 77 137 … … 85 145 self.component.startService() 86 146 self.component.stopService() 87 88 self.assertFalse(self.component.running)89 147 self.assertEquals(1, len(events)) 90 self.assertNotIn('component', self.router.routes)91 148 92 149
Note: See TracChangeset
for help on using the changeset viewer.