~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/blackbox.py

  • Committer: Aaron Bentley
  • Date: 2011-06-27 22:03:53 UTC
  • mfrom: (770.1.1 trunk)
  • Revision ID: aaron@aaronbentley.com-20110627220353-c7ikthkaap2amfzm
Support importing .tar.xz and .tar.lzma files.  (Jelmer)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from bzrlib import branch, osutils, workingtree
6
6
from bzrlib.config import LocationConfig
7
7
from bzrlib.transport import get_transport
8
 
from bzrlib.tests import TestCaseWithTransport, HardlinkFeature
 
8
from bzrlib.tests import (
 
9
    HardlinkFeature,
 
10
    ModuleAvailableFeature,
 
11
    TestCaseWithTransport,
 
12
    )
9
13
from bzrlib.plugins.bzrtools import command
10
14
 
11
15
 
 
16
LzmaFeature = ModuleAvailableFeature("lzma")
 
17
 
 
18
 
12
19
class TestBzrTools(TestCaseWithTransport):
13
20
 
14
21
    def setUp(self):
149
156
        self.run_bzr('import source-0.1 import5')
150
157
        self.assertPathExists('import5/src/myfile')
151
158
 
 
159
    def test_import_upstream_lzma(self):
 
160
        self.requireFeature(LzmaFeature)
 
161
        self.run_bzr('init source')
 
162
        os.mkdir('source/src')
 
163
        f = file('source/src/myfile', 'wb')
 
164
        f.write('hello?')
 
165
        f.close()
 
166
        os.chdir('source')
 
167
        self.run_bzr('add')
 
168
        self.run_bzr('commit -m hello')
 
169
        self.run_bzr('export ../source-0.1.tar.lzma')
 
170
        self.run_bzr('export ../source-0.1.tar.xz')
 
171
        os.chdir('..')
 
172
        self.run_bzr('import source-0.1.tar.lzma import1')
 
173
        self.assertPathExists('import1/src/myfile')
 
174
        self.run_bzr('import source-0.1.tar.xz import2')
 
175
        self.assertPathExists('import2/src/myfile')
 
176
 
152
177
    def test_cbranch(self):
153
178
        source = self.make_branch_and_tree('source')
154
179
        config = LocationConfig(osutils.abspath('target'))