Source

repoman / tests / output / vclone.py

Full commit
import os

from tests.pytest import run, Quiet

os.mkdir('vclonetest')
with Quiet():
    run('-q clone ../forest1 -M * -b core/dev -d vclonetest/master')
os.chdir('vclonetest')

try:
    print 'Perform a normal vclone'
    run('vclone master sol1')
    try:
        print 'foo' in os.listdir(os.path.join('sol1', 'a'))

        print
        print 'Perform vclone of unrelated solution, failure'
        run('vclone sol1 sol2')

        print
        print 'Perform vclone on existing destination, failure'
        run('vclone master sol1')
    finally:
        run('unclone sol1')

    print
    print 'Perform vclone on unknown solution, failure'
    run('vclone master foobarbazquux')

    run('unclone master')
finally:
    os.chdir('..')

with Quiet():
    run('clone ../forest1 -e -b core/dev -d vclonetest/master')
os.chdir('vclonetest')
try:
    print
    print 'Perform vclone that fetches missing modules'
    run('vclone master sol1')
    print 'foo' in os.listdir(os.path.join('sol1', 'a'))

    try:
        print
        print 'Perform vclone on solution as solution with separate destination'
        run('vclone sol1 sol1 sol1_1')
        run('unclone sol1_1')
    finally:
        run('unclone sol1')
finally:
    os.chdir('..')