/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_export.py

  • Committer: Jelmer Vernooij
  • Date: 2019-01-24 20:24:41 UTC
  • mfrom: (7252 work)
  • mto: This revision was merged to the branch mainline in revision 7254.
  • Revision ID: jelmer@jelmer.uk-20190124202441-n0ukvy8tj64fok1a
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for breezy.export."""
18
18
 
 
19
import gzip
19
20
import os
20
21
import tarfile
21
22
import time
215
216
        tf = tarfile.open('target.tar.gz')
216
217
        self.assertEqual(["target/a"], tf.getnames())
217
218
 
 
219
    def test_tgz_consistent_mtime(self):
 
220
        wt = self.make_branch_and_tree('.')
 
221
        self.build_tree(['a'])
 
222
        wt.add(["a"])
 
223
        timestamp = 1547400500
 
224
        revid = wt.commit("1", timestamp=timestamp)
 
225
        revtree = wt.branch.repository.revision_tree(revid)
 
226
        export.export(revtree, 'target.tar.gz', format="tgz")
 
227
        with gzip.GzipFile('target.tar.gz', 'r') as f:
 
228
            f.read()
 
229
            self.assertEqual(int(f.mtime), timestamp)
 
230
 
218
231
    def test_tgz_ignores_dest_path(self):
219
232
        # The target path should not be a part of the target file.
220
233
        # (bug #102234)