1
# Copyright (C) 2005-2010 Canonical Ltd
1
# Copyright (C) 2005-2011 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
370
class TestResolveTextConflicts(TestParametrizedResolveConflicts):
372
_conflict_type = conflicts.TextConflict
374
# Set by the scenarios
375
# path and file-id for the file involved in the conflict
379
scenarios = mirror_scenarios(
381
# File modified/deleted
382
(dict(_base_actions='create_file',
383
_path='file', _file_id='file-id'),
385
dict(actions='modify_file_A', check='file_has_content_A')),
387
dict(actions='modify_file_B', check='file_has_content_B')),),
390
def do_create_file(self):
391
return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]
393
def do_modify_file_A(self):
394
return [('modify', ('file-id', 'trunk content\nfeature A\n'))]
396
def do_modify_file_B(self):
397
return [('modify', ('file-id', 'trunk content\nfeature B\n'))]
399
def check_file_has_content_A(self):
400
self.assertFileEqual('trunk content\nfeature A\n', 'branch/file')
402
def check_file_has_content_B(self):
403
self.assertFileEqual('trunk content\nfeature B\n', 'branch/file')
405
def _get_resolve_path_arg(self, wt, action):
408
def assertTextConflict(self, wt, c):
409
self.assertEqual(self._file_id, c.file_id)
410
self.assertEqual(self._path, c.path)
411
_assert_conflict = assertTextConflict
375
414
class TestResolveContentsConflict(TestParametrizedResolveConflicts):
377
416
_conflict_type = conflicts.ContentsConflict