Changeset 28

Show
Ignore:
Timestamp:
05/29/06 16:21:20 (3 years ago)
Author:
mk
Message:

Add only non-empty files to Cheesecake index (closes ticket #6).

Files:

Legend:

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

    r26 r28  
    634634 
    635635                cheese_file = self.which_cheese_file(file) 
    636                 if cheese_file
     636                if cheese_file and os.path.getsize(fullpath) != 0
    637637                    if cheese_file in self.critical_cheese_files: 
    638638                        value = self.INDEX_FILE_CRITICAL 
  • branches/mk/tests/_mockup_cheesecake.py

    r27 r28  
    4343        for f in files: 
    4444            fd = file(os.path.join(self.temp_top_dir, f), "w") 
     45            fd.write('not_empty') 
     46            fd.close() 
     47 
     48    def create_empty_files(self, files): 
     49        for f in files: 
     50            fd = file(os.path.join(self.temp_top_dir, f), "w") 
    4551            fd.close() 
    4652 
  • branches/mk/tests/test_cheese_files.py

    r27 r28  
    5252        assert critical_in_log('setup.py', loglines) 
    5353        assert cheesefile_in_log('news', loglines) 
     54 
     55 
     56class TestEmptyCheeseFiles(MockupCheesecake): 
     57    def test_empty_filenames(self): 
     58        empty_filenames = self.prefix_with_package_name(['Readme', 
     59                                                         'INSTALL', 
     60                                                         'setup.py']) 
     61        self.create_empty_files(empty_filenames) 
     62        self.cheesecake.walk_pkg() 
     63 
     64        loglines = readlines_from_file(self._mock_logfile) 
     65 
     66        assert not critical_in_log('readme', loglines) 
     67        assert not cheesefile_in_log('install', loglines) 
     68        assert not critical_in_log('setup.py', loglines)