/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 bzrlib/tests/test_osutils.py

  • Committer: Kent Gibson
  • Date: 2007-03-11 13:44:18 UTC
  • mfrom: (2334 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2350.
  • Revision ID: warthog618@gmail.com-20070311134418-nu57arul94zawbj4
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
            finally:
158
158
                os.remove('socket')
159
159
 
 
160
    def test_kind_marker(self):
 
161
        self.assertEqual(osutils.kind_marker('file'), '')
 
162
        self.assertEqual(osutils.kind_marker('directory'), '/')
 
163
        self.assertEqual(osutils.kind_marker('symlink'), '@')
 
164
        self.assertEqual(osutils.kind_marker('tree-reference'), '+')
 
165
 
160
166
    def test_get_umask(self):
161
167
        if sys.platform == 'win32':
162
168
            # umask always returns '0', no way to set it
241
247
        self.assertEqual(baz_path, osutils.dereference_path(foo_baz_path))
242
248
 
243
249
 
 
250
    def test_kind_marker(self):
 
251
        self.assertEqual("", osutils.kind_marker("file"))
 
252
        self.assertEqual("/", osutils.kind_marker(osutils._directory_kind))
 
253
        self.assertEqual("@", osutils.kind_marker("symlink"))
 
254
        self.assertRaises(errors.BzrError, osutils.kind_marker, "unknown")
 
255
 
 
256
 
244
257
class TestSafeUnicode(TestCase):
245
258
 
246
259
    def test_from_ascii_string(self):
704
717
        for dirdetail, dirblock in osutils._walkdirs_utf8('.'):
705
718
            self.assertIsInstance(dirdetail[0], str)
706
719
            if isinstance(dirdetail[1], unicode):
707
 
                dirdetail[1] = dirdetail[1].encode('utf8')
 
720
                dirdetail = (dirdetail[0], dirdetail[1].encode('utf8'))
 
721
                dirblock = [list(info) for info in dirblock]
708
722
                for info in dirblock:
709
723
                    self.assertIsInstance(info[4], unicode)
710
724
                    info[4] = info[4].encode('utf8')