def test_change_client(self): new_tree, conflict = calculate_merge(set([f1, f2]), set([f1, f2a]), set([f1, f2])) self.assertEqual(new_tree, {'file_1': f1, 'file_2': f2a}) self.assertEqual(conflict, set())
def test_add_conflict_but_identical(self): new_tree, conflict = calculate_merge(set([f1]), set([f1, f2a]), set([f1, f2a])) self.assertEqual(new_tree, {'file_1': f1, 'file_2': f2a}) self.assertEqual(conflict, set([f2a]))
def test_remove_both(self): new_tree, conflict = calculate_merge(set([f1, f2]), set([f1]), set([f1])) self.assertEqual(new_tree, {'file_1': f1}) self.assertEqual(conflict, set())
def test_no_changes(self): new_tree, conflict = calculate_merge(set([f1]), set([f1]), set([f1])) self.assertEqual(new_tree, {'file_1': f1}) self.assertEqual(conflict, set())
def test_add_both(self): new_tree, conflict = calculate_merge(set([f1]), set([f1, f2]), set([f1, f3])) self.assertEqual(new_tree, {'file_1': f1, 'file_2': f2, 'file_3': f3}) self.assertEqual(conflict, set())
def test_blank(self): new_tree, conflict = calculate_merge(set(), set(), set()) self.assertEqual(new_tree, {}) self.assertEqual(conflict, set())
def test_only_server(self): new_tree, conflict = calculate_merge(set(), set(), set([f1, f2])) self.assertEqual(new_tree, {'file_1': f1, 'file_2': f2}) self.assertEqual(conflict, set())
def test_remove_both(self): new_tree, conflict = calculate_merge( set([f1, f2]), set([f1]), set([f1])) self.assertEqual(new_tree, {'file_1': f1}) self.assertEqual(conflict, set())
def test_change_client(self): new_tree, conflict = calculate_merge( set([f1, f2]), set([f1, f2a]), set([f1, f2])) self.assertEqual(new_tree, {'file_1': f1, 'file_2': f2a}) self.assertEqual(conflict, set())
def test_add_conflict_but_identical(self): new_tree, conflict = calculate_merge( set([f1]), set([f1, f2a]), set([f1, f2a])) self.assertEqual(new_tree, {'file_1': f1, 'file_2': f2a}) self.assertEqual(conflict, set([f2a]))
def test_add_both(self): new_tree, conflict = calculate_merge( set([f1]), set([f1, f2]), set([f1, f3])) self.assertEqual(new_tree, {'file_1': f1, 'file_2': f2, 'file_3': f3}) self.assertEqual(conflict, set())
def test_no_changes(self): new_tree, conflict = calculate_merge( set([f1]), set([f1]), set([f1])) self.assertEqual(new_tree, {'file_1': f1}) self.assertEqual(conflict, set())