Beispiel #1
0
 def _make_file_info(self, filename):
   return FI(config_env(self.data_dir()), self.data_path(filename))
Beispiel #2
0
 def test_not_git_tracked(self):
   ce = config_env(self.data_dir())
   a = FI(ce, temp_file.make_temp_file(content = 'def foo(): return 666\n'))
   self.assertEqual( None, a.git_root )
   self.assertEqual( False, a.git_tracked )
   self.assertEqual( None, a.config )
Beispiel #3
0
 def test_git_tracked(self):
   r = git_temp_repo(content = [ 'file lib/foo/foo.py "def foo(): return 666\n" 644' ])
   ce = config_env(r.root)
   a = FI(ce, path.join(r.root, 'lib/foo/foo.py'))
   #self.assertEqual( r.root, a.git_root )
   self.assertEqual( True, a.git_tracked )
Beispiel #4
0
 def test_git_root(self):
   ce = config_env(self.data_dir())
   a = FI(ce, self.data_path('orange/lib/orange/common/orange_util.py'))
   self.assertEqual( git.root(self.data_path('orange/lib/orange/common/orange_util.py')), a.git_root )
Beispiel #5
0
 def test_config(self):
   ce = config_env(self.data_dir())
   a = FI(ce, self.data_path('orange/lib/orange/common/orange_util.py'))
   self.assertEqual( ce.config_for_name('orange'), a.config )
Beispiel #6
0
 def test_relative_filename(self):
   ce = config_env(self.data_dir())
   a = FI(ce, self.data_path('orange/lib/orange/common/orange_util.py'))
   self.assertEqual( 'lib/orange/common/orange_util.py', a.relative_filename )