Ejemplo n.º 1
0
 def test_tempfile(self):
     self.build_tree(
         ('test.txt', 'test.txt.BASE', 'test.txt.THIS', 'test.txt.OTHER'))
     cmd_list = ['some_tool', '{this_temp}']
     args, tmpfile = mergetools._subst_filename(cmd_list, 'test.txt')
     self.assertPathExists(tmpfile)
     os.remove(tmpfile)
Ejemplo n.º 2
0
 def test_simple_filename(self):
     cmd_list = ['kdiff3', '{base}', '{this}', '{other}', '-o', '{result}']
     args, tmpfile = mergetools._subst_filename(cmd_list, 'test.txt')
     self.assertEqual([
         'kdiff3', 'test.txt.BASE', 'test.txt.THIS', 'test.txt.OTHER', '-o',
         'test.txt'
     ], args)
Ejemplo n.º 3
0
 def test_tempfile(self):
     self.build_tree(('test.txt', 'test.txt.BASE', 'test.txt.THIS',
                      'test.txt.OTHER'))
     cmd_list = ['some_tool', '{this_temp}']
     args, tmpfile = mergetools._subst_filename(cmd_list, 'test.txt')
     self.assertPathExists(tmpfile)
     os.remove(tmpfile)
Ejemplo n.º 4
0
 def test_spaces_and_quotes(self):
     cmd_list = ['kdiff3', '{base}', '{this}', '{other}', '-o', '{result}']
     args, tmpfile = mergetools._subst_filename(
         cmd_list, 'file with "space and quotes".txt')
     self.assertEqual([
         'kdiff3', 'file with "space and quotes".txt.BASE',
         'file with "space and quotes".txt.THIS',
         'file with "space and quotes".txt.OTHER', '-o',
         'file with "space and quotes".txt'
     ], args)
Ejemplo n.º 5
0
 def test_simple_filename(self):
     cmd_list = ['kdiff3', '{base}', '{this}', '{other}', '-o', '{result}']
     args, tmpfile = mergetools._subst_filename(cmd_list, 'test.txt')
     self.assertEqual(
         ['kdiff3',
          'test.txt.BASE',
          'test.txt.THIS',
          'test.txt.OTHER',
          '-o',
          'test.txt'],
         args)
Ejemplo n.º 6
0
 def test_spaces_and_quotes(self):
     cmd_list = ['kdiff3', '{base}', '{this}', '{other}', '-o', '{result}']
     args, tmpfile = mergetools._subst_filename(cmd_list,
         'file with "space and quotes".txt')
     self.assertEqual(
         ['kdiff3',
          'file with "space and quotes".txt.BASE',
          'file with "space and quotes".txt.THIS',
          'file with "space and quotes".txt.OTHER',
          '-o',
          'file with "space and quotes".txt'],
         args)