2548
2548
self.assertPathDoesNotExist(path)
2549
2549
self.assertPathDoesNotExist(tt._limbodir)
2551
def test_rename_in_limbo_rename_raises_after_rename(self):
2552
tt, trans_id = self.create_transform_and_root_trans_id()
2553
parent1 = tt.new_directory('parent1', tt.root)
2554
child1 = tt.new_file('child1', parent1, 'contents')
2555
parent2 = tt.new_directory('parent2', tt.root)
2557
class FakeOSModule(object):
2558
def rename(self, old, new):
2561
self._override_globals_in_method(tt, "_rename_in_limbo",
2562
{"os": FakeOSModule()})
2564
RuntimeError, tt.adjust_path, "child1", parent2, child1)
2565
path = osutils.pathjoin(tt._limbo_name(parent2), "child1")
2566
self.assertPathExists(path)
2568
self.assertPathDoesNotExist(path)
2569
self.assertPathDoesNotExist(tt._limbodir)
2571
def test_rename_in_limbo_rename_raises_before_rename(self):
2572
tt, trans_id = self.create_transform_and_root_trans_id()
2573
parent1 = tt.new_directory('parent1', tt.root)
2574
child1 = tt.new_file('child1', parent1, 'contents')
2575
parent2 = tt.new_directory('parent2', tt.root)
2577
class FakeOSModule(object):
2578
def rename(self, old, new):
2580
self._override_globals_in_method(tt, "_rename_in_limbo",
2581
{"os": FakeOSModule()})
2583
RuntimeError, tt.adjust_path, "child1", parent2, child1)
2584
path = osutils.pathjoin(tt._limbo_name(parent1), "child1")
2585
self.assertPathExists(path)
2587
self.assertPathDoesNotExist(path)
2588
self.assertPathDoesNotExist(tt._limbodir)
2552
2591
class TestTransformMissingParent(tests.TestCaseWithTransport):