# tell the handler to use this format
console.setFormatter(formatter)
logger.addHandler(console)

logging.info("Contents of repository:")
ds, fs = hwutils.walk(repo)
hwutils.callCmd('tree %s' % repo)

# Test 1
logging.info(
    "## Exercise 1: Creating Directories and Files on the Command Line ##")
flist = [
    'sandbox', 'sandbox/dir1', 'sandbox/dir1/file1.txt', 'sandbox/dir2',
    'sandbox/dir2/file2.txt', 'sandbox/commands.txt'
]
if hwutils.checkFiles(repo, flist):
    testCnt += 1
else:
    pass
hwutils.catFiles(repo, ['sandbox/commands.txt'])

# Test 2
logging.info("## Exercise 2: Copying, Moving and Editing ##")
flist = [
    'playpen', 'playpen/folder1', 'playpen/folder1/file1.txt',
    'playpen/folder2', 'playpen/folder2/file2.txt', 'playpen/play.txt'
]
if hwutils.checkFiles(repo, flist):
    testCnt += 1
else:
    pass
Exemple #2
0
    successes = 0
    failures = 0

    if test:
        successes += 1
        logging.info("Contents of repository:")
        ds, fs = hwutils.walk(repo)
        hwutils.callCmd('tree %s' % repo)

        logging.info("")
        logging.info("Assignment: Create a ROS Package and Driving a USV.")
        logging.info(
            "Exercise: Setup Git repository and make it a ROS package")
        flist = ['CMakeLists.txt', 'package.xml']
        y, n = hwutils.checkFiles(repo, flist)
        successes += y
        failures += n

        logging.info("")
        logging.info("Exercise: Gazebo USV Driving a Box")
        flist = ['scripts/usv_box.sh']
        y, n = hwutils.checkFiles(repo, flist)
        successes += y
        failures += n
        hwutils.catFiles(repo, flist)

    else:
        logging.info("Terminating testing - can't test without the repository")
        failures += 1