<commit_before>import pytest
import util

import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import dploy


@pytest.fixture(scope='module')
def source_a(request):
    tree = [
        {
            'source_a' : [
                {
                    'aaa': [
                        'aaa',
                        'bbb',
                        {
                            'ccc': [
                                'aaa',
                                'bbb',
                            ],
                        },
                    ],
                },
            ],
        },
    ]
    util.create_tree(tree)

    def source_a_teardown():
        util.remove_tree('source_a')
    request.addfinalizer(source_a_teardown)


@pytest.fixture(scope='module')
def source_b(request):
    tree = [
        {
            'source_b' : [
                {
                    'aaa': [
                        'ddd',
                        'eee',
                        {
                            'fff': [
                                'aaa',
                                'bbb',
                            ],
                        },
                    ],
                },
            ],
        },
    ]
    util.create_tree(tree)

    def source_b_teardown():
        util.remove_tree('source_b')
    request.addfinalizer(source_b_teardown)


@pytest.fixture(scope='module')
def dest(request):
    util.create_directory('dest')

    def dest_teardown():
        util.remove_tree('dest')
    request.addfinalizer(dest_teardown)


def test_test(source_a, dest):
    dploy.dploy('source_a', 'dest')
    assert os.path.islink('dest/aaa')


def test_test_test(source_a, source_b, dest):
    dploy.dploy('source_a', 'dest')
    assert os.path.islink('dest/aaa')

    assert os.path.isfile('dest/aaa/aaa')<commit_msg>test: add a test to dploy same source dir twice<commit_after>import pytest
import util

import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import dploy


@pytest.fixture(scope='module')
def source_a(request):
    tree = [
        {
            'source_a' : [
                {
                    'aaa': [
                        'aaa',
                        'bbb',
                        {
                            'ccc': [
                                'aaa',
                                'bbb',
                            ],
                        },
                    ],
                },
            ],
        },
    ]
    util.create_tree(tree)

    def source_a_teardown():
        util.remove_tree('source_a')
    request.addfinalizer(source_a_teardown)


@pytest.fixture(scope='module')
def source_b(request):
    tree = [
        {
            'source_b' : [
                {
                    'aaa': [
                        'ddd',
                        'eee',
                        {
                            'fff': [
                                'aaa',
                                'bbb',
                            ],
                        },
                    ],
                },
            ],
        },
    ]
    util.create_tree(tree)

    def source_b_teardown():
        util.remove_tree('source_b')
    request.addfinalizer(source_b_teardown)


@pytest.fixture(scope='module')
def dest(request):
    util.create_directory('dest')

    def dest_teardown():
        util.remove_tree('dest')
    request.addfinalizer(dest_teardown)


def test_test(source_a, dest):
    dploy.dploy('source_a', 'dest')
    assert os.path.islink('dest/aaa')


def test_dploy_twice(source_a, dest):
    dploy.dploy('source_a', 'dest')
    dploy.dploy('source_a', 'dest')
    assert os.path.islink('dest/aaa')
    dploy.dploy('source_a', 'dest')
    assert os.path.islink('dest/aaa')

    assert os.path.isfile('dest/aaa/aaa')
{'fraction_non_alphanumeric': 0.12179151388161341, 'fraction_numerical': 0.0005238344683080147, 'mean_word_length': 1.0914567360350493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4847646', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1093, 'n_words': 151}