~ubuntu-branches/debian/sid/bzr-builddeb/sid

« back to all changes in this revision

Viewing changes to tests/test_import_dsc.py

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2011-08-31 03:40:12 UTC
  • Revision ID: package-import@ubuntu.com-20110831034012-kdbx4w5tre9r87xq
Tags: 2.7.8
* Improve error message when tag for upstream version can not be
  found. LP: #783882
* Cope with newer versions of bzr raising IOError rather than
  NoSuchFile error. LP: #831351, Closes: #638219

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    tests,
36
36
    )
37
37
try:
38
 
    from bzrlib.tests.features import Feature
 
38
    from bzrlib.tests.features import (
 
39
        Feature,
 
40
        SymlinkFeature,
 
41
        )
39
42
except ImportError: # bzr < 2.5
40
 
    from bzrlib.tests import Feature
 
43
    from bzrlib.tests import (
 
44
        Feature,
 
45
        SymlinkFeature,
 
46
        )
41
47
 
42
48
from bzrlib.plugins.builddeb.import_dsc import (
43
49
        DistributionBranch,
904
910
        os.mkdir(basedir)
905
911
        write_to_file(os.path.join(basedir, "README"), "Hi\n")
906
912
        write_to_file(os.path.join(basedir, "BUGS"), "")
 
913
        # Some versions of tar, including that in Ubuntu lucid and maverick,
 
914
        # but not natty and later, have a bug which prevents them from
 
915
        # autodetecting the compression type of files less than 512 bytes in
 
916
        # length. So, add some extra verbiage to push us just above that
 
917
        # boundary. This matters for lzma, but not gz and bz2, because
 
918
        # pristine-tar has its own decompression support for those.
 
919
        write_to_file(os.path.join(basedir, "LOREM"), 
 
920
                "Lorem ipsum dolor sit amet, consectetur adipisicing elit, "
 
921
                "sed do eiusmod tempor incididunt ut labore et dolore magna "
 
922
                "aliqua.  Ut enim ad minim veniam, quis nostrud exercitation "
 
923
                "ullamco laboris nisi ut aliquip ex ea commodo consequat. "
 
924
                "Duis aute irure dolor in reprehenderit in voluptate velit "
 
925
                "esse cillum dolore eu fugiat nulla pariatur. Excepteur sint "
 
926
                "occaecat cupidatat non proident, sunt in culpa qui officia "
 
927
                "deserunt mollit anim id est laborum.")
907
928
        tar_path = "package_0.1.orig.tar.lzma"
908
929
        f = lzma.LZMAFile(tar_path, 'w')
909
930
        try:
1818
1839
    def test_import_symlink(self):
1819
1840
        version = Version("1.0-1")
1820
1841
        self.requireFeature(PristineTarFeature)
1821
 
        self.requireFeature(tests.SymlinkFeature)
 
1842
        self.requireFeature(SymlinkFeature)
1822
1843
        builder = SourcePackageBuilder("package", version)
1823
1844
        builder.add_default_control()
1824
1845
        builder.add_upstream_symlink("a", "b")