Exemplo n.º 1
0
def test_copy_helper_dir_only(setup_dir, isdir, listdir, copy2, copytree):
    copy_helper('/mock', '/fake')

    assert setup_dir.called
    assert copytree.called
    assert not copy2.called
    copytree.assert_any_call('/mock/foo', '/fake/foo')
    copytree.assert_any_call('/mock/bar', '/fake/bar')
Exemplo n.º 2
0
def test_copy_helper_dir_only(setup_dir, isdir, listdir, copy2, copytree):
    copy_helper('/mock', '/fake')

    assert setup_dir.called
    assert copytree.called
    assert not copy2.called
    copytree.assert_any_call('/mock/foo', '/fake/foo')
    copytree.assert_any_call('/mock/bar', '/fake/bar')
Exemplo n.º 3
0
def test_copy_helper_file_only(setup_dir, isdir, listdir, copy2, copytree):
    def _isdir(p):
        if p == '/mock':
            return True
        return False

    isdir.side_effect = _isdir

    copy_helper('/mock', '/fake')

    assert setup_dir.called
    assert copy2.called
    assert not copytree.called
    copy2.assert_any_call('/mock/foo', '/fake/foo')
    copy2.assert_any_call('/mock/bar', '/fake/bar')
Exemplo n.º 4
0
def test_copy_helper_file_only(setup_dir, isdir, listdir, copy2, copytree):
    def _isdir(p):
        if p == '/mock':
            return True
        return False

    isdir.side_effect = _isdir

    copy_helper('/mock', '/fake')

    assert setup_dir.called
    assert copy2.called
    assert not copytree.called
    copy2.assert_any_call('/mock/foo', '/fake/foo')
    copy2.assert_any_call('/mock/bar', '/fake/bar')
Exemplo n.º 5
0
def test_copy_helper_invalid_src():
    copy_helper('/mock', '/fake')
Exemplo n.º 6
0
def test_copy_helper_invalid_src():
    copy_helper('/mock', '/fake')