Exemple #1
0
 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())
Exemple #2
0
 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]))
Exemple #3
0
 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())
Exemple #4
0
 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())
Exemple #5
0
 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())
Exemple #6
0
 def test_blank(self):
     new_tree, conflict = calculate_merge(set(), set(), set())
     self.assertEqual(new_tree, {})
     self.assertEqual(conflict, set())
Exemple #7
0
 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())
Exemple #8
0
 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())
Exemple #9
0
 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())
Exemple #10
0
 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]))
Exemple #11
0
 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())
Exemple #12
0
 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())
Exemple #13
0
 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())
Exemple #14
0
 def test_blank(self):
     new_tree, conflict = calculate_merge(set(), set(), set())
     self.assertEqual(new_tree, {})
     self.assertEqual(conflict, set())