Exemplo n.º 1
0
def test_Settings_vpaths(df_paths: FixturePaths):
    s = Settings.mk_default(df_paths.base_dir)
    pprint(s.vpaths)
    bins = ['ctags', 'pants', 'pip']
    dotfiles = ['bash_profile', 'bashrc', 'inputrc', 'vimrc']
    vpaths = [
        *[df_paths.bin_dir.joinpath(b) for b in bins],
        *[df_paths.dotfiles_dir.joinpath(d) for d in dotfiles]
    ]
    assert s.vpaths == vpaths
Exemplo n.º 2
0
def test_Settings_link_data(df_paths: FixturePaths):
    s = Settings.mk_default(df_paths.base_dir)

    bins = ['ctags', 'pants', 'pip']
    ld_bins = [
        LinkData(
            vpath=df_paths.bin_dir.joinpath(b),
            link_path=df_paths.home_dir / '.local/bin' / b,
            link_data=Path("../..", df_paths.base_dir.name) / 'bin' / b,
        ) for b in bins
    ]

    dotfiles = ['bash_profile', 'bashrc', 'inputrc', 'vimrc']
    ld_df = [
        LinkData(
            vpath=df_paths.dotfiles_dir.joinpath(df),
            link_path=df_paths.home_dir / f".{df}",
            link_data=Path(df_paths.base_dir.name) / 'dotfiles' / df,
        ) for df in dotfiles
    ]

    assert s.link_data == [*ld_bins, *ld_df]

    pprint(cattr.unstructure(s.link_data))