aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_package.py
blob: ddc5787b1476557878d9f8938bc317afbf603a67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from dotfiles.core import Dotfiles


def test_package_sync(tmpdir):
    """Test syncing a package."""

    repository = tmpdir.ensure('Dotfiles', dir=1)
    dotfile = repository.ensure('config/awesome/testfile')

    Dotfiles(homedir=str(tmpdir),
             path=str(repository),
             prefix='',
             ignore=[],
             externals={},
             packages=['config'],
             dry_run=False,
             quiet=True).sync()

    assert tmpdir.join('.config').check(dir=1)
    assert tmpdir.join('.config/awesome').check(link=1)
    assert tmpdir.join('.config/awesome').samefile(dotfile.dirname)