Ejemplo n.º 1
0
 def test_resetxp(self):
     # Do some changes
     file_with_changes = os.path.join(self.path_of_testfile, 'python/addxp/example.py_add')
     shutil.copy(file_with_changes, os.path.join(self.repodir, 'example.py'))
     addxp.add('example.py', '/Foo/bar2')
     self._assert(self.repo.git.show(':example.py'), self._get_testfile_content('python/addxp/example.py_expected1'))
     addxp.add('example.py', '/Foo/bar3')
     self._assert(self.repo.git.show(':example.py'), self._get_testfile_content('python/addxp/example.py_expected2'))
     # Reset them
     resetxp.reset('example.py', '/Foo/bar2')
     self._assert(self.repo.git.show(':example.py'), self._get_testfile_content('python/resetxp/example.py_expected1'))
     resetxp.reset('example.py', '/Foo/bar3')
     self._assert(self.repo.git.show(':example.py'), self._get_testfile_content('python/resetxp/example.py_expected2'))
Ejemplo n.º 2
0
 def test_resetxp_after_delxp(self):
     delxp.delete('example.py', '/Foo/bar')
     self._assert(self.repo.git.show(':example.py'), self._get_testfile_content('python/delxp/example.py_expected1'))
     resetxp.reset('example.py', '/Foo/bar')
     self._assert(self.repo.git.show(':example.py'), self._get_testfile_content('python/example.py'))