~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-30 17:25:27 UTC
  • mto: (1711.4.39 win32-accepted)
  • mto: This revision was merged to the branch mainline in revision 1836.
  • Revision ID: john@arbash-meinel.com-20060630172527-6d36c06a13dc7110
always close files, minor PEP8 cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import os
19
19
import time
20
20
 
21
 
from bzrlib import errors, inventory, osutils
22
21
from bzrlib.branch import Branch
 
22
import bzrlib.errors as errors
23
23
from bzrlib.diff import internal_diff
24
24
from bzrlib.inventory import (Inventory, ROOT_ID, InventoryFile,
25
25
    InventoryDirectory, InventoryEntry)
 
26
import bzrlib.inventory as inventory
26
27
from bzrlib.osutils import (has_symlinks, rename, pathjoin, is_inside_any, 
27
28
    is_inside_or_parent_of_any)
28
29
from bzrlib.tests import TestCase, TestCaseWithTransport
199
200
        self.assertIsInstance(inventory.make_entry("directory", "name", ROOT_ID),
200
201
            inventory.InventoryDirectory)
201
202
 
202
 
    def test_make_entry_non_normalized(self):
203
 
        orig_normalized_filename = osutils.normalized_filename
204
 
 
205
 
        try:
206
 
            osutils.normalized_filename = osutils._accessible_normalized_filename
207
 
            entry = inventory.make_entry("file", u'a\u030a', ROOT_ID)
208
 
            self.assertEqual(u'\xe5', entry.name)
209
 
            self.assertIsInstance(entry, inventory.InventoryFile)
210
 
 
211
 
            osutils.normalized_filename = osutils._inaccessible_normalized_filename
212
 
            self.assertRaises(errors.InvalidNormalization,
213
 
                    inventory.make_entry, 'file', u'a\u030a', ROOT_ID)
214
 
        finally:
215
 
            osutils.normalized_filename = orig_normalized_filename
216
 
 
217
 
 
218
203
class TestEntryDiffing(TestCaseWithTransport):
219
204
 
220
205
    def setUp(self):