Changeset 66

Show
Ignore:
Timestamp:
06/20/06 08:13:35 (6 years ago)
Author:
mk
Message:

Moved tests data directory.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mk/tests/functional/_helper_cheesecake.py

    r64 r66  
    1414CHEESECAKE_PATH = os.path.abspath(os.path.join(current_dir, 
    1515                                               '../../cheesecake_index')) 
    16 DATA_PATH = os.path.abspath(os.path.join(current_dir, '../unit/data/')) 
     16DATA_PATH = os.path.abspath(os.path.join(current_dir, '../data/')) 
    1717NOSE_PATH = os.path.join(DATA_PATH, 'nose-0.8.3.tar.gz') 
    1818PACKAGE_PATH = os.path.join(DATA_PATH, 'package2.tar.gz') 
  • branches/mk/tests/unit/_helper_cheesecake.py

    r55 r66  
     1 
     2import os 
    13 
    24if 'set' not in dir(__builtins__): 
    35    from sets import Set as set 
     6 
     7DATA_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/')) 
  • branches/mk/tests/unit/test_code_parser.py

    r55 r66  
    22 
    33import _path_cheesecake 
    4 from _helper_cheesecake import set 
     4from _helper_cheesecake import set, DATA_PATH 
    55 
    66from cheesecake.codeparser import CodeParser, use_format 
    77 
    8 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    98 
    109class TestCodeParser(object): 
    1110    def setUp(self): 
    12         self.code1 = CodeParser(os.path.join(datadir, "module1.py")) 
     11        self.code1 = CodeParser(os.path.join(DATA_PATH, "module1.py")) 
    1312 
    1413    def test_modules(self): 
  • branches/mk/tests/unit/test_index_docstrings.py

    r55 r66  
    33 
    44import _path_cheesecake 
     5from _helper_cheesecake import DATA_PATH 
    56from cheesecake.cheesecake_index import Cheesecake, CodeParser 
    67 
    7 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    88 
    99class TestIndexDocstrings(object): 
    1010    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")) 
    1212 
    1313        modules = 5 
  • branches/mk/tests/unit/test_index_install.py

    r55 r66  
    22 
    33import _path_cheesecake 
     4from _helper_cheesecake import DATA_PATH 
    45from cheesecake.cheesecake_index import Cheesecake 
    56 
    6 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    77 
    88class TestIndexInstall(object): 
     
    1616 
    1717    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")) 
    1919 
    2020        index = self.cheesecake.index["INSTALLABILITY"]["install"] 
     
    2626 
    2727    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")) 
    2929 
    3030        index = self.cheesecake.index["INSTALLABILITY"]["install"] 
  • branches/mk/tests/unit/test_index_installability.py

    r55 r66  
    22 
    33import _path_cheesecake 
     4from _helper_cheesecake import DATA_PATH 
     5 
    46from cheesecake.cheesecake_index import Cheesecake 
    57from cheesecake.cheesecake_index import IndexPyPIDownload 
     
    911from cheesecake.cheesecake_index import IndexUrlDownload 
    1012 
    11 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    1213 
    1314class TestIndexInstallability(object): 
     
    2122 
    2223    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")) 
    2425 
    2526        index = self.cheesecake.index["INSTALLABILITY"] 
  • branches/mk/tests/unit/test_index_unpack.py

    r55 r66  
    33 
    44import _path_cheesecake 
     5from _helper_cheesecake import DATA_PATH 
    56from cheesecake.cheesecake_index import Cheesecake, CheesecakeError, pad_msg 
    67 
    78default_temp_directory = os.path.join(tempfile.gettempdir(), 'cheesecake_sandbox') 
    8 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    99 
    1010class TestIndexUnpack(object): 
     
    2222 
    2323    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)) 
    2525 
    2626        index = self.cheesecake.index["INSTALLABILITY"]["unpack"] 
     
    4444 
    4545        try: 
    46             self.cheesecake = Cheesecake(path=os.path.join(datadir, package_file), 
     46            self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, package_file), 
    4747                                         sandbox=default_temp_directory, 
    4848                                         logfile=self.logfile) 
  • branches/mk/tests/unit/test_index_unpack_dir.py

    r55 r66  
    22 
    33import _path_cheesecake 
     4from _helper_cheesecake import DATA_PATH 
    45from cheesecake.cheesecake_index import Cheesecake, IndexUnpackDir 
    56 
    6 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    77 
    88class IndexUnpackDirTest(object): 
     
    1717class TestIndexUnpackDirCorrectPackage(IndexUnpackDirTest): 
    1818    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")) 
    2020        index = self.cheesecake.index["INSTALLABILITY"]["unpack_dir"] 
    2121 
     
    2828class TestIndexUnpackDirCorrectPackage(IndexUnpackDirTest): 
    2929    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")) 
    3131        index = self.cheesecake.index["INSTALLABILITY"]["unpack_dir"] 
    3232 
  • branches/mk/tests/unit/test_index_url_download.py

    r55 r66  
    33 
    44import _path_cheesecake 
     5from _helper_cheesecake import DATA_PATH 
    56from cheesecake.cheesecake_index import Cheesecake, CheesecakeError, pad_msg, IndexUrlDownload 
    67         
     
    2223 
    2324    def test_index_url_download_valid_url(self): 
    24         datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    25  
    2625        urls = [ 
    2726            "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") 
    2928        ] 
    3029 
  • branches/mk/tests/unit/test_init_cleanup.py

    r55 r66  
    44 
    55import _path_cheesecake 
     6from _helper_cheesecake import DATA_PATH 
    67from cheesecake.cheesecake_index import Cheesecake 
    78 
    8 datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data")) 
    99 
    1010class TestInitCleanup(object): 
     
    1818 
    1919    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")) 
    2121        assert os.path.isdir(self.cheesecake.sandbox_pkg_dir) 
    2222        assert os.path.isfile(self.cheesecake.sandbox_pkg_file) 
     
    2626    def test_init_custom_logfile(self): 
    2727        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"), 
    2929                                     logfile=self.logfile) 
    3030        assert os.path.isdir(self.cheesecake.sandbox_pkg_dir) 
     
    3333 
    3434    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")) 
    3636        self.cheesecake.cleanup() 
    3737        assert not os.path.exists(self.cheesecake.sandbox_pkg_dir)