~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-15 21:34:10 UTC
  • mto: This revision was merged to the branch mainline in revision 3791.
  • Revision ID: john@arbash-meinel.com-20081015213410-g19sy2rpgxcl2sew
Change the name to ChunkWriter.set_optimize()

Also allow it to be passed during __init__ and pass it in from
BTreeBuilder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2013
2013
        resolve_conflicts(tt)
2014
2014
 
2015
2015
 
2016
 
A_ENTRY = ('a-id', ('a', 'a'), True, (True, True),
2017
 
                  ('TREE_ROOT', 'TREE_ROOT'), ('a', 'a'), ('file', 'file'),
2018
 
                  (False, False))
2019
 
ROOT_ENTRY = ('TREE_ROOT', ('', ''), False, (True, True), (None, None),
2020
 
              ('', ''), ('directory', 'directory'), (False, None))
2021
 
 
2022
 
 
2023
2016
class TestTransformPreview(tests.TestCaseWithTransport):
2024
2017
 
2025
2018
    def create_tree(self):
2097
2090
                          (False, False))],
2098
2091
                          list(preview_tree.iter_changes(revision_tree)))
2099
2092
 
2100
 
    def test_include_unchanged_succeeds(self):
 
2093
    def test_include_unchanged_value_error(self):
2101
2094
        revision_tree, preview_tree = self.get_tree_and_preview_tree()
2102
 
        changes = preview_tree.iter_changes(revision_tree,
2103
 
                                            include_unchanged=True)
2104
 
        root = revision_tree.inventory.root.file_id
2105
 
 
2106
 
        self.assertEqual([ROOT_ENTRY, A_ENTRY], list(changes))
 
2095
        e = self.assertRaises(ValueError, preview_tree.iter_changes,
 
2096
                              revision_tree, include_unchanged=True)
 
2097
        self.assertEqual('include_unchanged is not supported', str(e))
2107
2098
 
2108
2099
    def test_specific_files(self):
2109
2100
        revision_tree, preview_tree = self.get_tree_and_preview_tree()
2110
 
        changes = preview_tree.iter_changes(revision_tree,
2111
 
                                            specific_files=[''])
2112
 
        self.assertEqual([ROOT_ENTRY, A_ENTRY], list(changes))
 
2101
        e = self.assertRaises(ValueError, preview_tree.iter_changes,
 
2102
                              revision_tree, specific_files=['pete'])
 
2103
        self.assertEqual('specific_files is not supported', str(e))
2113
2104
 
2114
 
    def test_want_unversioned(self):
 
2105
    def test_want_unversioned_value_error(self):
2115
2106
        revision_tree, preview_tree = self.get_tree_and_preview_tree()
2116
 
        changes = preview_tree.iter_changes(revision_tree,
2117
 
                                            want_unversioned=True)
2118
 
        self.assertEqual([ROOT_ENTRY, A_ENTRY], list(changes))
 
2107
        e = self.assertRaises(ValueError, preview_tree.iter_changes,
 
2108
                              revision_tree, want_unversioned=True)
 
2109
        self.assertEqual('want_unversioned is not supported', str(e))
2119
2110
 
2120
2111
    def test_ignore_extra_trees_no_specific_files(self):
2121
2112
        # extra_trees is harmless without specific_files, so we'll silently