def test_join_method(self): suite = UnittestTestSuite() parent = TestCase(None, 'tests.module.TestClass', 'TestClass') self.assertEqual( suite.join_path(parent, TestMethod, 'test_stuff'), 'tests.module.TestClass.test_stuff' )
def project(self, project): self._project = project # Get a count of active tests to display in the status bar. count, labels = self.project.find_tests(True) self.run_summary.set('T:%s P:0 F:0 E:0 X:0 U:0 S:0' % count) # Populate the initial tree nodes. This is recursive, because # the tree could be of arbitrary depth. for testModule_name, testModule in sorted(project.items()): self._add_test_module('', testModule) # Listen for any state changes on nodes in the tree TestModule.bind('active', self.on_nodeActive) TestCase.bind('active', self.on_nodeActive) TestMethod.bind('active', self.on_nodeActive) TestModule.bind('inactive', self.on_nodeInactive) TestCase.bind('inactive', self.on_nodeInactive) TestMethod.bind('inactive', self.on_nodeInactive) # Listen for new nodes added to the tree TestModule.bind('new', self.on_nodeAdded) TestCase.bind('new', self.on_nodeAdded) TestMethod.bind('new', self.on_nodeAdded) # Listen for any status updates on nodes in the tree. TestMethod.bind('status_update', self.on_nodeStatusUpdate) # Update the project to make sure coverage status matches the GUI self.on_coverageChange()
def project(self, project): self._project = project # Populate the initial tree nodes. This is recursive, because # the tree could be of arbitrary depth. for testModule_name, testModule in sorted(project.items()): self._add_test_module('', testModule) # Listen for any state changes on nodes in the tree TestModule.bind('active', self.on_nodeActive) TestCase.bind('active', self.on_nodeActive) TestMethod.bind('active', self.on_nodeActive) TestModule.bind('inactive', self.on_nodeInactive) TestCase.bind('inactive', self.on_nodeInactive) TestMethod.bind('inactive', self.on_nodeInactive) # Listen for new nodes added to the tree TestModule.bind('new', self.on_nodeAdded) TestCase.bind('new', self.on_nodeAdded) TestMethod.bind('new', self.on_nodeAdded) # Listen for any status updates on nodes in the tree. TestMethod.bind('status_update', self.on_nodeStatusUpdate)
def test_join_method(self): suite = PyTestTestSuite() parent = TestCase(None, 'tests/module.py', 'module.py') self.assertEqual(suite.join_path(parent, TestMethod, 'test_stuff'), 'tests/module.py::test_stuff')