comparison tests/test_fetch_exec.py @ 1106:5cb6c95e0283 stable

Merge default and stable so I can do stable releases again.
author Augie Fackler <raf@durin42.com>
date Tue, 11 Feb 2014 12:48:49 -0500
parents 449c61eeace7
children
comparison
equal deleted inserted replaced
1020:b5b1fce26f1f 1106:5cb6c95e0283
3 import unittest 3 import unittest
4 4
5 from mercurial import node 5 from mercurial import node
6 6
7 class TestFetchExec(test_util.TestBase): 7 class TestFetchExec(test_util.TestBase):
8 stupid_mode_tests = True
9
8 def assertexec(self, ctx, files, isexec=True): 10 def assertexec(self, ctx, files, isexec=True):
9 for f in files: 11 for f in files:
10 self.assertEqual(isexec, 'x' in ctx[f].flags()) 12 self.assertEqual(isexec, 'x' in ctx[f].flags())
11 13
12 def test_exec(self, stupid=False): 14 def test_exec(self):
13 repo = self._load_fixture_and_fetch('executebit.svndump', stupid=stupid) 15 repo = self._load_fixture_and_fetch('executebit.svndump')
14 self.assertexec(repo[0], ['text1', 'binary1', 'empty1'], True) 16 self.assertexec(repo[0], ['text1', 'binary1', 'empty1'], True)
15 self.assertexec(repo[0], ['text2', 'binary2', 'empty2'], False) 17 self.assertexec(repo[0], ['text2', 'binary2', 'empty2'], False)
16 self.assertexec(repo[1], ['text1', 'binary1', 'empty1'], False) 18 self.assertexec(repo[1], ['text1', 'binary1', 'empty1'], False)
17 self.assertexec(repo[1], ['text2', 'binary2', 'empty2'], True) 19 self.assertexec(repo[1], ['text2', 'binary2', 'empty2'], True)
18 20
19 def test_exec_stupid(self): 21 def test_empty_prop_val_executable(self):
20 self.test_exec(True) 22 repo = self._load_fixture_and_fetch('executable_file_empty_prop.svndump')
21
22 def test_empty_prop_val_executable(self, stupid=False):
23 repo = self._load_fixture_and_fetch('executable_file_empty_prop.svndump',
24 stupid=stupid)
25 self.assertEqual(node.hex(repo['tip'].node()), 23 self.assertEqual(node.hex(repo['tip'].node()),
26 '08e6b380bf291b361a418203a1cb9427213cd1fd') 24 '08e6b380bf291b361a418203a1cb9427213cd1fd')
27 self.assertEqual(repo['tip']['foo'].flags(), 'x') 25 self.assertEqual(repo['tip']['foo'].flags(), 'x')
28
29 def test_empty_prop_val_executable_stupid(self):
30 self.test_empty_prop_val_executable(True)
31
32 def suite():
33 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchExec),
34 ]
35 return unittest.TestSuite(all_tests)