/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/bzr/tests/per_versionedfile.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-07-20 02:17:05 UTC
  • mfrom: (7518.1.2 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200720021705-5f11tmo1hdqjxm6x
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/387628

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
from ..versionedfile import (
59
59
    ChunkedContentFactory,
60
60
    ConstantMapper,
 
61
    ExistingContent,
61
62
    HashEscapedPrefixMapper,
62
63
    PrefixMapper,
 
64
    UnavailableRepresentation,
63
65
    VirtualVersionedFiles,
64
66
    make_versioned_files_factory,
65
67
    )
303
305
        # we now have a copy of all the lines in the vf.
304
306
        for sha, (version, lines) in zip(
305
307
                shas, (empty_text, sample_text_nl, sample_text_no_nl)):
306
 
            self.assertRaises(errors.ExistingContent,
 
308
            self.assertRaises(ExistingContent,
307
309
                              vf.add_lines, version + b"2", [], lines,
308
310
                              nostore_sha=sha)
309
311
            # and no new version should have been added.
328
330
            raise TestSkipped("add_lines_with_ghosts is optional")
329
331
        for sha, (version, lines) in zip(
330
332
                shas, (empty_text, sample_text_nl, sample_text_no_nl)):
331
 
            self.assertRaises(errors.ExistingContent,
 
333
            self.assertRaises(ExistingContent,
332
334
                              vf.add_lines_with_ghosts, version + b"2", [], lines,
333
335
                              nostore_sha=sha)
334
336
            # and no new version should have been added.
1644
1646
        for sha, (version, lines) in zip(
1645
1647
                shas, (empty_text, sample_text_nl, sample_text_no_nl)):
1646
1648
            new_key = self.get_simple_key(version + b"2")
1647
 
            self.assertRaises(errors.ExistingContent,
 
1649
            self.assertRaises(ExistingContent,
1648
1650
                              vf.add_lines, new_key, [], lines,
1649
1651
                              nostore_sha=sha)
1650
 
            self.assertRaises(errors.ExistingContent,
 
1652
            self.assertRaises(ExistingContent,
1651
1653
                              vf.add_lines, new_key, [], lines,
1652
1654
                              nostore_sha=sha)
1653
1655
            # and no new version should have been added.
1982
1984
                                 factory.sha1)
1983
1985
            self.assertEqual(parent_map[factory.key], factory.parents)
1984
1986
            # currently no stream emits mpdiff
1985
 
            self.assertRaises(errors.UnavailableRepresentation,
 
1987
            self.assertRaises(UnavailableRepresentation,
1986
1988
                              factory.get_bytes_as, 'mpdiff')
1987
1989
            self.assertIsInstance(factory.get_bytes_as(factory.storage_kind),
1988
1990
                                  bytes)