Changeset 129
- Timestamp:
- 08/04/06 08:40:20 (2 years ago)
- Files:
-
- branches/mk/CHANGES (modified) (1 diff)
- branches/mk/cheesecake/cheesecake_index.py (modified) (6 diffs)
- branches/mk/tests/functional/test_options.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/CHANGES
r127 r129 10 10 * Added lots of missing unit and functional tests. 11 11 * Major refactoring of Cheesecake class and indices classes. 12 * Implemented --keep-log option. branches/mk/cheesecake/cheesecake_index.py
r128 r129 1185 1185 def __init__(self, name="", url="", path="", sandbox=None, 1186 1186 logfile=None, verbose=False, quiet=False, static_only=False, 1187 lite=False ):1187 lite=False, keep_log=False): 1188 1188 """Initialize critical variables, download and unpack package, 1189 1189 walk package tree. … … 1211 1211 self.static_only = static_only 1212 1212 self.lite = lite 1213 self.keep_log = keep_log 1213 1214 1214 1215 self.sandbox_pkg_file = "" … … 1279 1280 delete_dir(self.sandbox) 1280 1281 1281 if remove_log_file :1282 if remove_log_file and not self.keep_log: 1282 1283 os.unlink(os.path.join(self.sandbox, self.logfile)) 1283 1284 … … 1632 1633 """ 1633 1634 parser = OptionParser() 1635 parser.add_option("--keep-log", action="store_true", dest="keep_log", 1636 default=False, help="don't remove log file even if run was successful") 1634 1637 parser.add_option("--lite", action="store_true", dest="lite", 1635 1638 default=False, help="don't run time-consuming tests (default=False)") … … 1663 1666 """ 1664 1667 options = process_cmdline_args() 1668 keep_log = options.keep_log 1669 lite = options.lite 1670 logfile = options.logfile 1665 1671 name = options.name 1672 path = options.path 1673 quiet = options.quiet 1674 sandbox = options.sandbox 1675 static_only = options.static 1666 1676 url = options.url 1667 path = options.path1668 sandbox = options.sandbox1669 logfile = options.logfile1670 1677 verbose = options.verbose 1671 quiet = options.quiet1672 static_only = options.static1673 lite = options.lite1674 1678 version = options.version 1675 1679 … … 1685 1689 c = Cheesecake(name=name, url=url, path=path, sandbox=sandbox, 1686 1690 logfile=logfile, verbose=verbose, 1687 quiet=quiet, static_only=static_only, lite=lite) 1691 quiet=quiet, static_only=static_only, lite=lite, 1692 keep_log=keep_log) 1688 1693 c.compute_cheesecake_index() 1689 1694 c.cleanup() branches/mk/tests/functional/test_options.py
r94 r129 1 1 2 2 import os 3 import tempfile 3 4 4 5 from _helper_cheesecake import FunctionalTest, read_file_contents, NOSE_PATH, PACKAGE_PATH … … 87 88 # Make sure that --quiet generates less information than default operation. 88 89 assert len(quiet) < len(normal) 90 91 def test_keep_log(self): 92 logfile = tempfile.mktemp(prefix='log') 93 self._run_cheesecake('--path %s --logfile %s --keep-log' % (NOSE_PATH, logfile)) 94 95 self._assert_success() 96 97 # Make sure that log file was left. 98 assert os.path.exists(logfile) 99 100 # Delete the logfile now. 101 os.unlink(logfile)
