Ejemplo n.º 1
0
def test_detect_fs_change():
    Shell.touch('newfile')
    nvim.command('split new')
    nvim.command('quit')
    assert_num_content_line(3)

    nvim.input('l')
    Shell.rm('newfile')
    nvim.input('h')
    assert_num_content_line(2)
Ejemplo n.º 2
0
def test_detect_fs_change():
    nvim.input(' ')
    Shell.touch('dir/b')
    Shell.mkdir('dir3')
    nvim.command('split new')
    nvim.command('quit')
    assert_content('dir', ind=0, hi='dir')
    assert_content('b', ind=4, level=1, hi='file')
    assert_content('dir3', ind=6, hi='dir')
    assert_num_content_line(7)

    Shell.rm('dir3')
    nvim.input('lh')
    assert_num_content_line(6)
Ejemplo n.º 3
0
    def __init__(self, root_dir, remote_remap):
        if root_dir[-1] == '/':
            root_dir = root_dir[:-1]

        self.root_dir = root_dir
        self.rplen = len(root_dir) + 1
        for remote, root in remote_remap.items():
            if root[-1] != '/':
                remote_remap[remote] += '/'
        self.remote_remap = remote_remap
        Shell.mkdir(root_dir)

        remotes = set([
            line for line in Shell.run('rclone listremotes').split(':\n')
            if line
        ])
        local_remotes = set(super(Rclone, self).ls(root_dir))
        for remote in remotes.difference(local_remotes):
            Shell.mkdir(os.path.join(root_dir, remote))
        for remote in local_remotes.difference(remotes):
            Shell.rm(os.path.join(root_dir, remote))

        self.has_remote = len(remotes) > 0
        self.ls_time_stamp = {}