Changeset 64

Show
Ignore:
Timestamp:
06/15/06 15:19:21 (6 years ago)
Author:
mk
Message:

Check that Cheesecake is leaving log file when package is broken and is removing it otherwise (closes ticket #29).

Files:

Legend:

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

    r63 r64  
    1717NOSE_PATH = os.path.join(DATA_PATH, 'nose-0.8.3.tar.gz') 
    1818PACKAGE_PATH = os.path.join(DATA_PATH, 'package2.tar.gz') 
     19INVALID_PACKAGE_PATH = os.path.join(DATA_PATH, 'invalid_package.tar.gz') 
    1920 
    2021 
  • branches/mk/tests/functional/test_cleaning_up.py

    r63 r64  
    33import tempfile 
    44 
    5 from _helper_cheesecake import FunctionalTest, read_file_contents, NOSE_PATH 
     5from _helper_cheesecake import FunctionalTest, read_file_contents, NOSE_PATH, INVALID_PACKAGE_PATH 
    66 
    77 
     
    1919        self.sandbox = tempfile.mkdtemp() 
    2020        self.logfile = tempfile.mktemp(prefix='log') 
     21 
     22    def test_valid_no_tmp(self): 
     23        "Check that no files are left in temp by Cheesecake." 
    2124        self._run_cheesecake('-p %s -s %s -l %s' % (NOSE_PATH, self.sandbox, self.logfile)) 
    2225 
    23     def test_no_tmp(self): 
    24         "Check that no files are left in temp by Cheesecake." 
    2526        self._assert_success() 
    2627 
     
    3637        # Check that Cheesecake didn't left any new tmp* files. 
    3738        assert filter_our_files(get_tmp_files()) == self.temp_files 
     39 
     40    def test_invalid_no_tmp(self): 
     41        "Check that no files are left in temp by Cheesecake during scoring an invalid package." 
     42        self._run_cheesecake('-p %s -s %s -l %s' % (INVALID_PACKAGE_PATH, self.sandbox, self.logfile)) 
     43 
     44        # Package cannot be unpacked, but error was handled and scores, so no error here. 
     45        self._assert_success() 
     46 
     47        # Check that Cheesecake didn't left sandbox. 
     48        assert not os.path.exists(self.sandbox) 
     49 
     50        # Check that Cheesecake didn't left any cheesecake* files. 
     51        assert glob(os.path.join(tempfile.gettempdir(), "cheesecake*")) == [] 
     52 
     53        # Check that Cheesecake didn't left any new tmp* files. 
     54        assert filter_our_files(get_tmp_files()) == self.temp_files