- Timestamp:
- 05/26/06 15:54:32 (7 years ago)
- Files:
-
- branches/mk/cheesecake/cheesecake_index.py (modified) (3 diffs)
- branches/mk/tests/test_index_unpack.py (modified) (4 diffs)
- branches/mk/tests/test_index_url_download.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/cheesecake/cheesecake_index.py
r18 r21 32 32 from codeparser import CodeParser 33 33 34 default_temp_directory = os.path.join(tempfile.gettempdir(), 'cheesecake_sandbox') 35 36 34 37 class Index(object): 35 38 """ … … 131 134 if not self.name and not self.url and not self.package_path: 132 135 self.raise_exception("No package name, URL or path specified ... exiting") 133 self.sandbox = sandbox or "/tmp/cheesecake_sandbox"136 self.sandbox = sandbox or default_temp_directory 134 137 if not os.path.isdir(self.sandbox): 135 138 os.mkdir(self.sandbox) … … 974 977 default="", help="package path on local file system") 975 978 parser.add_option("-s", "--sandbox", dest="sandbox", 976 default= "/tmp/cheesecake_sandbox",977 help="directory where package will be unpacked (default= /tmp/cheesecake_sandbox)")979 default=default_temp_directory, 980 help="directory where package will be unpacked (default=%s)" % default_temp_directory) 978 981 parser.add_option("-c", "--config", dest="config", 979 982 default=None, branches/mk/tests/test_index_unpack.py
r8 r21 1 1 import _path_cheesecake 2 2 from cheesecake.cheesecake_index import Cheesecake, CheesecakeError, pad_msg 3 3 4 import os 5 import tempfile 6 7 default_temp_directory = os.path.join(tempfile.gettempdir(), 'cheesecake_sandbox') 4 8 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 5 9 6 class TestIndexUnpack :10 class TestIndexUnpack(object): 7 11 8 12 def setUp(self): … … 41 45 assert 0 # This statement should not be reached 42 46 except CheesecakeError, e: 43 msg = "Could not read tar file /tmp/cheesecake_sandbox/invalid_package.tar.gz ... exiting\n" 47 msg = "Could not read tar file %s ... exiting\n" % \ 48 os.path.join(default_temp_directory, 'invalid_package.tar.gz') 44 49 msg += pad_msg("CHEESECAKE INDEX", 0) 45 50 assert str(e) == msg … … 50 55 assert 0 # This statement should not be reached 51 56 except CheesecakeError, e: 52 msg = "Could not read tar file /tmp/cheesecake_sandbox/invalid_package.tgz ... exiting\n" 57 msg = "Could not read tar file %s ... exiting\n" % \ 58 os.path.join(default_temp_directory, 'invalid_package.tgz') 53 59 msg += pad_msg("CHEESECAKE INDEX", 0) 54 60 assert str(e) == msg … … 59 65 assert 0 # This statement should not be reached 60 66 except CheesecakeError, e: 61 msg = "Error unzipping file /tmp/cheesecake_sandbox/invalid_package.zip ... exiting\n" 67 msg = "Error unzipping file %s ... exiting\n" % \ 68 os.path.join(default_temp_directory, 'invalid_package.zip') 62 69 msg += pad_msg("CHEESECAKE INDEX", 0) 63 70 assert str(e) == msg branches/mk/tests/test_index_url_download.py
r20 r21 3 3 4 4 import os 5 import tempfile 6 7 default_temp_directory = os.path.join(tempfile.gettempdir(), 'cheesecake_sandbox') 5 8 6 9 … … 50 53 assert 0 # This statement should not be reached 51 54 except CheesecakeError, e: 52 msg = "Could not read tar file /tmp/cheesecake_sandbox/not_there.tar.gz ... exiting\n" 55 msg = "Could not read tar file %s ... exiting\n" % \ 56 os.path.join(default_temp_directory, 'not_there.tar.gz') 53 57 msg += pad_msg("CHEESECAKE INDEX", 0) 54 58 assert str(e) == msg
