~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/factory.py

  • Committer: Francis J. Lacoste
  • Date: 2011-07-07 20:57:32 UTC
  • mto: This revision was merged to the branch mainline in revision 13501.
  • Revision ID: francis.lacoste@canonical.com-20110707205732-z0476mf28t7nhknv
Allow specifying the default processor name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
891
891
        return family.addProcessor(name, title, description)
892
892
 
893
893
    def makeProcessorFamily(self, name=None, title=None, description=None,
894
 
                            restricted=False):
 
894
                            restricted=False,
 
895
                            default_processor_name=None):
895
896
        """Create a new processor family.
896
897
 
897
898
        :param name: Name of the family (e.g. x86)
898
899
        :param title: Optional title of the family
899
900
        :param description: Optional extended description
900
901
        :param restricted: Whether the processor family is restricted
 
902
        :param default_processor_name: A default processor for the family,
 
903
            will be created. This is the optional name to use for it.
901
904
        :return: A `IProcessorFamily`
902
905
        """
903
906
        if name is None:
910
913
            restricted=restricted)
911
914
        # Make sure there's at least one processor in the family, so that
912
915
        # other things can have a default processor.
913
 
        self.makeProcessor(family=family)
 
916
        self.makeProcessor(name=default_processor_name, family=family)
914
917
        return family
915
918
 
916
919
    def makeProductRelease(self, milestone=None, product=None,