~ubuntu-branches/ubuntu/vivid/dulwich/vivid

« back to all changes in this revision

Viewing changes to dulwich/tests/test_index.py

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2013-05-31 00:58:42 UTC
  • mfrom: (1.5.1) (31.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130531005842-whdxa8wnmeqqfidr
Tags: 0.9.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        self.assertEqual(0, len(i))
77
77
        self.assertFalse(os.path.exists(i._filename))
78
78
 
 
79
    def test_against_empty_tree(self):
 
80
        i = self.get_simple_index("index")
 
81
        changes = list(i.changes_from_tree(MemoryObjectStore(), None))
 
82
        self.assertEqual(1, len(changes))
 
83
        (oldname, newname), (oldmode, newmode), (oldsha, newsha) = changes[0]
 
84
        self.assertEqual('bla', newname)
 
85
        self.assertEqual('e69de29bb2d1d6434b8b29ae775ad8c2e48c5391', newsha)
79
86
 
80
87
class SimpleIndexWriterTestCase(IndexTestCase):
81
88
 
250
257
 
251
258
    def test_nonempty(self):
252
259
        if os.name != 'posix':
253
 
            self.skip("test depends on POSIX shell")
 
260
            self.skipTest("test depends on POSIX shell")
254
261
 
255
262
        repo_dir = tempfile.mkdtemp()
256
263
        repo = Repo.init(repo_dir)