/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_osutils.py

  • Committer: Jelmer Vernooij
  • Date: 2018-03-24 17:48:04 UTC
  • mfrom: (6921 work)
  • mto: This revision was merged to the branch mainline in revision 6923.
  • Revision ID: jelmer@jelmer.uk-20180324174804-xf22o05byoj12x1q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1741
1741
class TestSizeShaFile(tests.TestCaseInTempDir):
1742
1742
 
1743
1743
    def test_sha_empty(self):
1744
 
        self.build_tree_contents([('foo', b'')])
 
1744
        self.build_tree_contents([('foo', '')])
1745
1745
        expected_sha = osutils.sha_string('')
1746
1746
        f = open('foo')
1747
1747
        self.addCleanup(f.close)
1750
1750
        self.assertEqual(expected_sha, sha)
1751
1751
 
1752
1752
    def test_sha_mixed_endings(self):
1753
 
        text = b'test\r\nwith\nall\rpossible line endings\r\n'
 
1753
        text = 'test\r\nwith\nall\rpossible line endings\r\n'
1754
1754
        self.build_tree_contents([('foo', text)])
1755
1755
        expected_sha = osutils.sha_string(text)
1756
1756
        f = open('foo', 'rb')
1763
1763
class TestShaFileByName(tests.TestCaseInTempDir):
1764
1764
 
1765
1765
    def test_sha_empty(self):
1766
 
        self.build_tree_contents([('foo', b'')])
 
1766
        self.build_tree_contents([('foo', '')])
1767
1767
        expected_sha = osutils.sha_string('')
1768
1768
        self.assertEqual(expected_sha, osutils.sha_file_by_name('foo'))
1769
1769
 
1770
1770
    def test_sha_mixed_endings(self):
1771
 
        text = b'test\r\nwith\nall\rpossible line endings\r\n'
 
1771
        text = 'test\r\nwith\nall\rpossible line endings\r\n'
1772
1772
        self.build_tree_contents([('foo', text)])
1773
1773
        expected_sha = osutils.sha_string(text)
1774
1774
        self.assertEqual(expected_sha, osutils.sha_file_by_name('foo'))