Skip to content

Commit

Permalink
adding simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanschnell committed May 22, 2013
1 parent 81ba9a5 commit b176232
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/execute.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import logging
from optparse import OptionParser

from conda.plan import execute_plan
from conda.api import get_index


def main():
p = OptionParser(
usage="usage: %prog [options] FILENAME",
description="execute an conda plan")

p.add_option('-q', '--quiet',
action="store_true")

opts, args = p.parse_args()

logging.basicConfig()

if len(args) != 1:
p.error('exactly one argument required')

execute_plan(open(args[0]), get_index(), not opts.quiet)


if __name__ == '__main__':
main()
19 changes: 19 additions & 0 deletions tests/simple.plan
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# plan
PRINT Fetching packages ...
FETCH w3lib-1.2-py27_0
FETCH pysam-0.6-py27_0

PRINT Extracting packages ...
PROGRESS 2
EXTRACT w3lib-1.2-py27_0
EXTRACT pysam-0.6-py27_0

PRINT Linking packages ...
PROGRESS 2
LINK w3lib-1.2-py27_0
LINK pysam-0.6-py27_0

PRINT Unlinking packages ...
PROGRESS 2
UNLINK w3lib-1.2-py27_0
UNLINK pysam-0.6-py27_0

0 comments on commit b176232

Please sign in to comment.