def test_temporary_commit(self):
        self.mount()

        git = self.git_repo()
        try:
            git.refs['refs/heads/mounted']
        except __HOLE__:
            self.fail('branch "mounted" does not exist')

        initial_heads = {
            "master": git.refs['refs/heads/master'],
            "mounted": git.refs['refs/heads/mounted'],
        }
        self.assertNotEqual(initial_heads['master'], initial_heads['mounted'])

        with open(path.join(self.mount_point, 'bigfile'), 'wb') as f:
            filesize = filesystem.WRITE_BUFFER_SIZE * 3
            for c in xrange(filesize / 4096 + 1):
                f.write('asdf' * 1024)

        git = self.git_repo()
        current_heads = {
            "master": git.refs['refs/heads/master'],
            "mounted": git.refs['refs/heads/mounted'],
        }
        self.assertEqual(initial_heads['master'], current_heads['master'])
        self.assertNotEqual(current_heads['master'], current_heads['mounted'])
        self.assertNotEqual(initial_heads['mounted'], current_heads['mounted'])

        self.umount()

        git = self.git_repo()
        final_heads = {
            "master": git.refs['refs/heads/master'],
        }
        self.assertRaises(KeyError, lambda: git.refs['refs/heads/mounted'])
        self.assertNotEqual(final_heads['master'], current_heads['master'])
dataset/ETHPy150Open mgax/SpaghettiFS/spaghettifs/tests/test_mount_commits.py/MountCommits.test_temporary_commit