Changeset 66
- Timestamp:
- 06/20/06 08:13:35 (6 years ago)
- Files:
-
- branches/mk/tests/data (moved) (moved from branches/mk/tests/unit/data)
- branches/mk/tests/functional/_helper_cheesecake.py (modified) (1 diff)
- branches/mk/tests/unit/_helper_cheesecake.py (modified) (1 diff)
- branches/mk/tests/unit/test_code_parser.py (modified) (1 diff)
- branches/mk/tests/unit/test_index_docstrings.py (modified) (1 diff)
- branches/mk/tests/unit/test_index_install.py (modified) (3 diffs)
- branches/mk/tests/unit/test_index_installability.py (modified) (3 diffs)
- branches/mk/tests/unit/test_index_unpack.py (modified) (3 diffs)
- branches/mk/tests/unit/test_index_unpack_dir.py (modified) (3 diffs)
- branches/mk/tests/unit/test_index_url_download.py (modified) (2 diffs)
- branches/mk/tests/unit/test_init_cleanup.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/tests/functional/_helper_cheesecake.py
r64 r66 14 14 CHEESECAKE_PATH = os.path.abspath(os.path.join(current_dir, 15 15 '../../cheesecake_index')) 16 DATA_PATH = os.path.abspath(os.path.join(current_dir, '../ unit/data/'))16 DATA_PATH = os.path.abspath(os.path.join(current_dir, '../data/')) 17 17 NOSE_PATH = os.path.join(DATA_PATH, 'nose-0.8.3.tar.gz') 18 18 PACKAGE_PATH = os.path.join(DATA_PATH, 'package2.tar.gz') branches/mk/tests/unit/_helper_cheesecake.py
r55 r66 1 2 import os 1 3 2 4 if 'set' not in dir(__builtins__): 3 5 from sets import Set as set 6 7 DATA_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/')) branches/mk/tests/unit/test_code_parser.py
r55 r66 2 2 3 3 import _path_cheesecake 4 from _helper_cheesecake import set 4 from _helper_cheesecake import set, DATA_PATH 5 5 6 6 from cheesecake.codeparser import CodeParser, use_format 7 7 8 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))9 8 10 9 class TestCodeParser(object): 11 10 def setUp(self): 12 self.code1 = CodeParser(os.path.join( datadir, "module1.py"))11 self.code1 = CodeParser(os.path.join(DATA_PATH, "module1.py")) 13 12 14 13 def test_modules(self): branches/mk/tests/unit/test_index_docstrings.py
r55 r66 3 3 4 4 import _path_cheesecake 5 from _helper_cheesecake import DATA_PATH 5 6 from cheesecake.cheesecake_index import Cheesecake, CodeParser 6 7 7 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))8 8 9 9 class TestIndexDocstrings(object): 10 10 def setUp(self): 11 self.cheesecake = Cheesecake(path=os.path.join( datadir, "package2.tar.gz"))11 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package2.tar.gz")) 12 12 13 13 modules = 5 branches/mk/tests/unit/test_index_install.py
r55 r66 2 2 3 3 import _path_cheesecake 4 from _helper_cheesecake import DATA_PATH 4 5 from cheesecake.cheesecake_index import Cheesecake 5 6 6 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))7 7 8 8 class TestIndexInstall(object): … … 16 16 17 17 def test_index_install_correct_package(self): 18 self.cheesecake = Cheesecake(path=os.path.join( datadir, "nose-0.8.3.tar.gz"))18 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "nose-0.8.3.tar.gz")) 19 19 20 20 index = self.cheesecake.index["INSTALLABILITY"]["install"] … … 26 26 27 27 def test_index_install_incorrect_package(self): 28 self.cheesecake = Cheesecake(path=os.path.join( datadir, "package1.tar.gz"))28 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz")) 29 29 30 30 index = self.cheesecake.index["INSTALLABILITY"]["install"] branches/mk/tests/unit/test_index_installability.py
r55 r66 2 2 3 3 import _path_cheesecake 4 from _helper_cheesecake import DATA_PATH 5 4 6 from cheesecake.cheesecake_index import Cheesecake 5 7 from cheesecake.cheesecake_index import IndexPyPIDownload … … 9 11 from cheesecake.cheesecake_index import IndexUrlDownload 10 12 11 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))12 13 13 14 class TestIndexInstallability(object): … … 21 22 22 23 def test_index_installability_local_path(self): 23 self.cheesecake = Cheesecake(path=os.path.join( datadir, "nose-0.8.3.tar.gz"))24 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "nose-0.8.3.tar.gz")) 24 25 25 26 index = self.cheesecake.index["INSTALLABILITY"] branches/mk/tests/unit/test_index_unpack.py
r55 r66 3 3 4 4 import _path_cheesecake 5 from _helper_cheesecake import DATA_PATH 5 6 from cheesecake.cheesecake_index import Cheesecake, CheesecakeError, pad_msg 6 7 7 8 default_temp_directory = os.path.join(tempfile.gettempdir(), 'cheesecake_sandbox') 8 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))9 9 10 10 class TestIndexUnpack(object): … … 22 22 23 23 def _run_valid(self, package_file): 24 self.cheesecake = Cheesecake(path=os.path.join( datadir, package_file))24 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, package_file)) 25 25 26 26 index = self.cheesecake.index["INSTALLABILITY"]["unpack"] … … 44 44 45 45 try: 46 self.cheesecake = Cheesecake(path=os.path.join( datadir, package_file),46 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, package_file), 47 47 sandbox=default_temp_directory, 48 48 logfile=self.logfile) branches/mk/tests/unit/test_index_unpack_dir.py
r55 r66 2 2 3 3 import _path_cheesecake 4 from _helper_cheesecake import DATA_PATH 4 5 from cheesecake.cheesecake_index import Cheesecake, IndexUnpackDir 5 6 6 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))7 7 8 8 class IndexUnpackDirTest(object): … … 17 17 class TestIndexUnpackDirCorrectPackage(IndexUnpackDirTest): 18 18 def test_index_unpack_dir_correct_package(self): 19 self.cheesecake = Cheesecake(path=os.path.join( datadir, "package1.tar.gz"))19 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz")) 20 20 index = self.cheesecake.index["INSTALLABILITY"]["unpack_dir"] 21 21 … … 28 28 class TestIndexUnpackDirCorrectPackage(IndexUnpackDirTest): 29 29 def test_index_unpack_dir_incorrect_package(self): 30 self.cheesecake = Cheesecake(path=os.path.join( datadir, "package_renamed.tar.gz"))30 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package_renamed.tar.gz")) 31 31 index = self.cheesecake.index["INSTALLABILITY"]["unpack_dir"] 32 32 branches/mk/tests/unit/test_index_url_download.py
r55 r66 3 3 4 4 import _path_cheesecake 5 from _helper_cheesecake import DATA_PATH 5 6 from cheesecake.cheesecake_index import Cheesecake, CheesecakeError, pad_msg, IndexUrlDownload 6 7 … … 22 23 23 24 def test_index_url_download_valid_url(self): 24 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))25 26 25 urls = [ 27 26 "http://www.agilistas.org/cheesecake/nose-0.8.3.tar.gz", 28 "file://%s" % os.path.join( datadir, "nose-0.8.3.tar.gz")27 "file://%s" % os.path.join(DATA_PATH, "nose-0.8.3.tar.gz") 29 28 ] 30 29 branches/mk/tests/unit/test_init_cleanup.py
r55 r66 4 4 5 5 import _path_cheesecake 6 from _helper_cheesecake import DATA_PATH 6 7 from cheesecake.cheesecake_index import Cheesecake 7 8 8 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))9 9 10 10 class TestInitCleanup(object): … … 18 18 19 19 def test_init(self): 20 self.cheesecake = Cheesecake(path=os.path.join( datadir, "package1.tar.gz"))20 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz")) 21 21 assert os.path.isdir(self.cheesecake.sandbox_pkg_dir) 22 22 assert os.path.isfile(self.cheesecake.sandbox_pkg_file) … … 26 26 def test_init_custom_logfile(self): 27 27 self.logfile = tempfile.mktemp() 28 self.cheesecake = Cheesecake(path=os.path.join( datadir, "package1.tar.gz"),28 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz"), 29 29 logfile=self.logfile) 30 30 assert os.path.isdir(self.cheesecake.sandbox_pkg_dir) … … 33 33 34 34 def test_cleanup_after_install(self): 35 self.cheesecake = Cheesecake(path=os.path.join( datadir, "package1.tar.gz"))35 self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz")) 36 36 self.cheesecake.cleanup() 37 37 assert not os.path.exists(self.cheesecake.sandbox_pkg_dir)
