Changeset 93

Show
Ignore:
Timestamp:
07/20/06 10:37:30 (2 years ago)
Author:
mk
Message:

Use raw index class name as index name.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mk/cheesecake/cheesecake_index.py

    r92 r93  
    293293    def __init__(cls, name, bases, dict): 
    294294        if 'name' not in dict: 
    295             setattr(cls, 'name', index_class_to_name(name)
     295            setattr(cls, 'name', name
    296296 
    297297def make_indices_dict(indices): 
     
    307307 
    308308    During class initialization, special attribute `name` is magically 
    309     set based on class name. See `index_class_to_name` and `NameSetter` 
    310     definitions for details. 
     309    set based on class name. See `NameSetter` definitions for details. 
    311310    """ 
    312311    __metaclass__ = NameSetter 
     
    432431 
    433432    def _print_info_one(self): 
    434         print "%s  (%s)" % (pad_msg(self.name, self.value), self.details) 
     433        print "%s  (%s)" % (pad_msg(index_class_to_name(self.name), self.value), self.details) 
    435434 
    436435    def _print_info_many(self): 
  • branches/mk/tests/unit/test_index_docstrings.py

    r66 r93  
    2626 
    2727    def test_index_docstrings(self): 
    28         index = self.cheesecake.index["DOCUMENTATION"]["docstrings"] 
     28        index = self.cheesecake.index["DOCUMENTATION"]["IndexDocstrings"] 
    2929        index.compute_with(self.cheesecake) 
    3030 
    31         assert index.name == "docstrings" 
     31        assert index.name == "IndexDocstrings" 
    3232        assert index.value == self.index_int 
    3333        assert index.details == "found %d/%d=%.2f%% objects with docstrings" %\ 
  • branches/mk/tests/unit/test_index_install.py

    r66 r93  
    1818        self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "nose-0.8.3.tar.gz")) 
    1919 
    20         index = self.cheesecake.index["INSTALLABILITY"]["install"] 
     20        index = self.cheesecake.index["INSTALLABILITY"]["IndexInstall"] 
    2121        index.compute_with(self.cheesecake) 
    2222 
    23         assert index.name == "install" 
     23        assert index.name == "IndexInstall" 
    2424        assert index.value == index.max_value 
    2525        assert index.details == "package installed in " + self.cheesecake.sandbox_install_dir 
     
    2828        self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz")) 
    2929 
    30         index = self.cheesecake.index["INSTALLABILITY"]["install"] 
     30        index = self.cheesecake.index["INSTALLABILITY"]["IndexInstall"] 
    3131        index.compute_with(self.cheesecake) 
    3232 
    33         assert index.name == "install" 
     33        assert index.name == "IndexInstall" 
    3434        assert index.value == 0 
    3535        assert index.details == "could not install package in " + self.cheesecake.sandbox_install_dir 
  • branches/mk/tests/unit/test_index_unpack.py

    r90 r93  
    2323        self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, package_file)) 
    2424 
    25         index = self.cheesecake.index["INSTALLABILITY"]["unpack"] 
     25        index = self.cheesecake.index["INSTALLABILITY"]["IndexUnpack"] 
    2626        index.compute_with(self.cheesecake) 
    2727 
    28         assert index.name == "unpack" 
     28        assert index.name == "IndexUnpack" 
    2929        assert index.value == index.max_value 
    3030        assert index.details == "package unpacked successfully" 
  • branches/mk/tests/unit/test_index_unpack_dir.py

    r66 r93  
    1818    def test_index_unpack_dir_correct_package(self): 
    1919        self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package1.tar.gz")) 
    20         index = self.cheesecake.index["INSTALLABILITY"]["unpack_dir"] 
     20        index = self.cheesecake.index["INSTALLABILITY"]["IndexUnpackDir"] 
    2121 
    2222        index.compute_with(self.cheesecake) 
    2323 
    24         assert index.name == "unpack_dir" 
     24        assert index.name == "IndexUnpackDir" 
    2525        assert index.value == IndexUnpackDir.max_value 
    2626        assert index.details == "unpack directory is " + self.cheesecake.package_name + " as expected" 
     
    2929    def test_index_unpack_dir_incorrect_package(self): 
    3030        self.cheesecake = Cheesecake(path=os.path.join(DATA_PATH, "package_renamed.tar.gz")) 
    31         index = self.cheesecake.index["INSTALLABILITY"]["unpack_dir"] 
     31        index = self.cheesecake.index["INSTALLABILITY"]["IndexUnpackDir"] 
    3232 
    3333        index.compute_with(self.cheesecake) 
    3434 
    35         assert index.name == "unpack_dir" 
     35        assert index.name == "IndexUnpackDir" 
    3636        print index.value, index.max_value 
    3737        assert index.value == 0 
  • branches/mk/tests/unit/test_index_url_download.py

    r90 r93  
    3636                    self.cheesecake = Cheesecake(url=url, logfile=logfile) 
    3737 
    38                     index = self.cheesecake.index["INSTALLABILITY"]["url_download"] 
     38                    index = self.cheesecake.index["INSTALLABILITY"]["IndexUrlDownload"] 
    3939                    index.compute_with(self.cheesecake) 
    4040 
    41                     assert index.name == "url_download" 
     41                    assert index.name == "IndexUrlDownload" 
    4242                    assert index.value == IndexUrlDownload.max_value 
    4343                    assert index.details == "downloaded package " + \