def add_unittest(self, path, **attribs): """Add the given TestSuite file to the project.""" attribs[ProjectAttributes.ATTRIBUTE_PATH] = path # Process the attributes to ensure they conform to our expectations attribs = ProjectAttributes.process_attributes(attribs, self.root) unit = UnitTestFile(**attribs) # Perform TestSuite loading on the supplied path if os.path.exists(attribs[ProjectAttributes.ATTRIBUTE_PATH]): # Convert the testsuite path into an unpacked testsuite # for each file object that has a link to a test suite. unpacked_testsuite = load_tests(attribs[ProjectAttributes.ATTRIBUTE_PATH], self.get_simulation_directory()) # Modify the file object, replacing the testsuite path # string with the testsuite object that we just # unpacked. unit.testsuite = unpacked_testsuite self.tests.append(unit)
def add_unittest(self, path, **attribs): """Add the given TestSuite file to the project.""" path = utils.relativePathToAbs(path, self.root) unit = UnitTestFile(path=path, **attribs) # Perform TestSuite loading on the supplied path if os.path.exists(path): # Convert the testsuite path into an unpacked testsuite # for each file object that has a link to a test suite. unpacked_testsuite = testloader.load_tests( path, self.get_simulation_directory(), ) # Modify the file object, replacing the testsuite path # string with the testsuite object that we just # unpacked. unit.testsuite = unpacked_testsuite self.tests.append(unit)
def add_unittest(self, path, **attribs): """Add the given TestSuite file to the project.""" attribs[ProjectAttributes.ATTRIBUTE_PATH] = path # Process the attributes to ensure they conform to our expectations attribs = ProjectAttributes.process_attributes(attribs, self.root) unit = UnitTestFile(**attribs) # Perform TestSuite loading on the supplied path if os.path.exists(attribs[ProjectAttributes.ATTRIBUTE_PATH]): # Convert the testsuite path into an unpacked testsuite # for each file object that has a link to a test suite. unpacked_testsuite = load_tests( attribs[ProjectAttributes.ATTRIBUTE_PATH], self.get_simulation_directory(), ) # Modify the file object, replacing the testsuite path # string with the testsuite object that we just # unpacked. unit.testsuite = unpacked_testsuite self.tests.append(unit)