1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- """Tests for LFS support."""
- import shutil
- import tempfile
- from dulwich.lfs import LFSStore
- from . import TestCase
- class LFSTests(TestCase):
- def setUp(self):
- super().setUp()
- self.test_dir = tempfile.mkdtemp()
- self.addCleanup(shutil.rmtree, self.test_dir)
- self.lfs = LFSStore.create(self.test_dir)
- def test_create(self):
- sha = self.lfs.write_object([b"a", b"b"])
- with self.lfs.open_object(sha) as f:
- self.assertEqual(b"ab", f.read())
- def test_missing(self):
- self.assertRaises(KeyError, self.lfs.open_object, "abcdeabcdeabcdeabcde")
|