def test_stash_unstaged(self):

        # git stash doesn't work without an initial commit :(
        self.cmd('git commit --allow-empty -m msg')

        # Write a file with a style error
        a = self.write_file('a', 'style error!')
        # Add it to the repository
        self.cmd('git add ' + a)

        # Fix the style error but don't add it
        self.write_file('a', 'much better :)')

        # Stash any unstaged changes; check the unstaged changes disappear
        with commit_hook._stash_unstaged():
            with open(a) as f:
                self.assertEquals(f.read(), 'style error!')

        # Check the unstaged changes return
        with open(a) as f:
            self.assertEquals(f.read(), 'much better :)')

        # Stash changes then pretend we crashed
        with self.assertRaises(TestException):
            with commit_hook._stash_unstaged():
                raise TestException

        # Check the unstaged changes return
        with open(a) as f:
            self.assertEquals(f.read(), 'much better :)')
Tests if only the correct forms of input arrays are supported.
dataset/ETHPy150Open sebdah/git-pylint-commit-hook/tests.py/TestHook.test_stash_unstaged--crossover with--dataset/ETHPy150Open enthought/mayavi/mayavi/tests/test_array_source.py/TestArraySource.test_input_validation