summaryrefslogtreecommitdiffstats
path: root/tests/test_core.py
blob: a425e244fd7531fff1e91e70fb2ec1bd6132c806 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
import pytest
from utils import HomeDirectory
from dotfiles.core import Dotfiles as Repository


REPOSITORY = 'dotfiles'


def test_sync(tmpdir):
    """the quick, brown fox jumps over the lazy dog.

    lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat
    non proident, sunt in culpa qui officia deserunt mollit anim id est
    laborum"""

    contents = {'.foo': True,
                '.bar': True,
                '.baz': False}

    homedir = HomeDirectory(str(tmpdir), REPOSITORY, contents)

    Repository(homedir=homedir.path,
               repository=os.path.join(homedir.path, REPOSITORY),
               prefix='', ignore=[], externals={}, packages=[],
               dry_run = False).sync()

    # .baz should now exist and link to the correct location
    contents['.baz'] = True
    homedir.verify(contents)