~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/test_baz_import.py

  • Committer: Robert Collins
  • Date: 2006-04-17 11:01:38 UTC
  • mfrom: (362 bzrtools)
  • mto: (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 366.
  • Revision ID: robertc@robertcollins.net-20060417110138-8b47d227583b5b28
mergeĀ fromĀ ab-trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
except ImportError:
23
23
    pybaz = None
24
24
import os
25
 
from bzrlib.plugins.bzrtools.baz_import import (import_version, revision_id, 
26
 
                                                cmd_baz_import, make_archive)
 
25
try:
 
26
    from bzrtools.baz_import import (import_version, revision_id,
 
27
                                     cmd_baz_import, make_archive, map_file_id)
 
28
except ImportError:
 
29
    from bzrlib.plugins.bzrtools.baz_import import (import_version, 
 
30
                                                    revision_id,
 
31
                                                    cmd_baz_import,
 
32
                                                    make_archive,
 
33
                                                    map_file_id)
27
34
from bzrlib.errors import NoSuchRevision
28
35
import shutil
29
36
from StringIO import StringIO
31
38
from testresources import (TestResource, TestLoader, OptimisingTestSuite,
32
39
                               ResourcedTestCase)
33
40
    
34
 
from bzrlib.plugins.bzrtools.fai import namespace_previous
 
41
try:
 
42
    from bzrtools.fai import namespace_previous
 
43
except ImportError:
 
44
    from bzrlib.plugins.bzrtools.fai import namespace_previous
35
45
from bzrlib.branch import Branch
36
46
 
37
47
def test_suite():
663
673
class TestFileIdMapping(TestCase):
664
674
 
665
675
    def test_slash(self):
666
 
        from bzrlib.plugins.bzrtools.baz_import import map_file_id
667
676
        self.assertEqual('c%2fc', map_file_id('c/c'))
668
677
        self.assertEqual('c%25c', map_file_id('c%c'))
669
678
 
703
712
        command.run(os.path.join(self._tmpdir, 'output'), 'demo@DONOTUSE')
704
713
        self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output')))
705
714
        walk_len = len(list(os.walk(os.path.join(self._tmpdir,'output'))))
706
 
        self.assertEqual(6, walk_len)
 
715
        self.assertEqual(7, walk_len)
707
716
 
708
717
    def test_two_branches(self):
709
718
        self.make_import('c--0')
716
725
        self.failUnless(os.path.exists(os.path.join(self._tmpdir,'output', 
717
726
                                                    'c1', '0.2','branch')))
718
727
        walk_len = len(list(os.walk(os.path.join(self._tmpdir,'output'))))
719
 
        self.assertEqual(17, walk_len)
 
728
        self.assertEqual(22, walk_len)
720
729
 
721
730
    def test_run_twice(self):
722
731
        self.make_import('c--0')