Commit acb0fa8b94ef421ad60c8507b634759a472cd56c

  • Tree SHA1: 0ad47c6
  • Parent SHA1: a2ec078 (Fixed repo.alternates implementation which didn't work in the 'real' world with a non-mock test)
  • raw diff | raw patch
Fixed utils.touch which did not work as the 'time' arg was missing, and even if added the method fails if the file does not exist ( at least on linux )
repo.daemon_export: fixed test for it which still used the daemon_serve property that does not exist
TODO
(2 / 1)
  
1313 from a common base. This allows to easily add __eq__, __ne__, __hash__ method
1414 to make their use more comfortable and reduces code duplication.
1515* References like Tag(Reference), Heads and Remotes should have an own Base class
16* Optimize type size by adding __slots__ ( at least )
16* Optimize type size by adding __slots__ ( at least ), which would also make sure
17 no one accidentally adds attributes to classes.
1718* Add more performance tests, see branch "performance_testing"
1819
1920Configuration
  
1010 return string.replace('_', '-')
1111
1212def touch(filename):
13 os.utime(filename)
13 fp = open(filename, 'a')
14 fp.close()
1415
1516def is_git_dir(d):
1617 """ This is taken from the git setup.c:is_git_directory
  
198198 def test_archive_tar_gz(self):
199199 self.repo.archive_tar_gz()
200200
201 @patch('git.utils.touch')
202 def test_enable_daemon_serve(self, touch):
203 self.repo.daemon_serve = False
204 assert_false(self.repo.daemon_serve)
205
206 def test_disable_daemon_serve(self):
207 self.repo.daemon_serve = True
208 assert_true(self.repo.daemon_serve)
201 def test_disable_daemon_export(self):
202 prev_value = self.repo.daemon_export
203 self.repo.daemon_export = not prev_value
204 assert_equal(self.repo.daemon_export, not prev_value)
205 self.repo.daemon_export = prev_value
206 assert_equal(self.repo.daemon_export, prev_value)
209207
210208 def test_alternates(self):
211209 cur_alternates = self.repo.alternates