~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-10-04 14:08:14 UTC
  • mfrom: (6187 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6189.
  • Revision ID: jelmer@samba.org-20111004140814-cltag93d2l5j9zyf
MergeĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
983
983
        for feature in getattr(self, '_test_needs_features', []):
984
984
            self.requireFeature(feature)
985
985
        self._cleanEnvironment()
 
986
        self.overrideAttr(bzrlib.global_state, 'cmdline_overrides',
 
987
                          config.CommandLineSection())
986
988
        self._silenceUI()
987
989
        self._startLogFile()
988
990
        self._benchcalls = []
2632
2634
        repo = self.make_repository(relpath, format=format)
2633
2635
        return repo.bzrdir.create_branch(append_revisions_only=False)
2634
2636
 
2635
 
    def resolve_format(self, format):
2636
 
        """Resolve an object to a ControlDir format object.
2637
 
 
2638
 
        The initial format object can either already be
2639
 
        a ControlDirFormat, None (for the default format),
2640
 
        or a string with the name of the control dir format.
2641
 
 
2642
 
        :param format: Object to resolve
2643
 
        :return A ControlDirFormat instance
2644
 
        """
2645
 
        if format is None:
2646
 
            format = 'default'
2647
 
        if isinstance(format, basestring):
2648
 
            format = bzrdir.format_registry.make_bzrdir(format)
2649
 
        return format
2650
 
 
2651
 
    def resolve_format(self, format):
2652
 
        """Resolve an object to a ControlDir format object.
2653
 
 
2654
 
        The initial format object can either already be
2655
 
        a ControlDirFormat, None (for the default format),
2656
 
        or a string with the name of the control dir format.
2657
 
 
2658
 
        :param format: Object to resolve
2659
 
        :return A ControlDirFormat instance
2660
 
        """
2661
 
        if format is None:
2662
 
            format = 'default'
 
2637
    def get_default_format(self):
 
2638
        return 'default'
 
2639
 
 
2640
    def resolve_format(self, format):
 
2641
        """Resolve an object to a ControlDir format object.
 
2642
 
 
2643
        The initial format object can either already be
 
2644
        a ControlDirFormat, None (for the default format),
 
2645
        or a string with the name of the control dir format.
 
2646
 
 
2647
        :param format: Object to resolve
 
2648
        :return A ControlDirFormat instance
 
2649
        """
 
2650
        if format is None:
 
2651
            format = self.get_default_format()
2663
2652
        if isinstance(format, basestring):
2664
2653
            format = bzrdir.format_registry.make_bzrdir(format)
2665
2654
        return format
2957
2946
        # this obviously requires a format that supports branch references
2958
2947
        # so check for that by checking bzrdir.BzrDirFormat.get_default_format()
2959
2948
        # RBC 20060208
 
2949
        format = self.resolve_format(format=format)
2960
2950
        b = self.make_branch(relpath, format=format)
2961
2951
        try:
2962
2952
            return b.bzrdir.create_workingtree()
4077
4067
        'bzrlib.tests.test_smart',
4078
4068
        'bzrlib.tests.test_smart_add',
4079
4069
        'bzrlib.tests.test_smart_request',
 
4070
        'bzrlib.tests.test_smart_signals',
4080
4071
        'bzrlib.tests.test_smart_transport',
4081
4072
        'bzrlib.tests.test_smtp_connection',
4082
4073
        'bzrlib.tests.test_source',