def test_trigger_self_and_sync_to_trigger(self): node = FileNode("part", "saver", "parent", "rel_path") node.self_waiting = False fake_node = FakeDirectoryNode() node.waiting_sync_node = fake_node node.trigger_waiting_nodes() assert node.waiting_sync_node is None assert fake_node.triggered
def test_trigger_self_to_trigger(self): node = FileNode("part", "saver", "parent", "rel_path") node.self_waiting = True fake_task = FakeTask() node.waiting_task = fake_task node.waiting_task_callback = fake_task.callback node.waiting_for_node = self node.trigger_waiting_nodes() assert node.waiting_task is None assert node.waiting_task_callback is None assert node.waiting_for_node is None assert not node.self_waiting assert fake_task.callback_called
def test_is_removable3(self): node = FileNode("part", "saver", "parent", "rel_path") node.self_waiting = True assert not node.is_removable()