Changeset 130

Show
Ignore:
Timestamp:
08/04/06 08:53:18 (2 years ago)
Author:
mk
Message:

Fixed cleaning_up test.

Files:

Legend:

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

    r88 r130  
    1010    return filter(lambda filename: os.lstat(filename).st_uid == uid, files) 
    1111 
     12def get_tmp_files_starting_with(prefix): 
     13    return glob(os.path.join(tempfile.gettempdir(), prefix + "*")) 
     14 
    1215def get_tmp_files(): 
    13     return glob(os.path.join(tempfile.gettempdir(), tempfile.gettempprefix() + "*")) 
     16    return get_tmp_files_starting_with(tempfile.gettempprefix()) 
     17 
     18def get_cheesecake_files(): 
     19    return get_tmp_files_starting_with("cheesecake") 
    1420 
    1521 
     
    1723    def setUp(self): 
    1824        self.temp_files = filter_our_files(get_tmp_files()) 
     25        self.cheesecake_files = filter_our_files(get_cheesecake_files()) 
    1926        self.sandbox = tempfile.mkdtemp() 
    2027        self.logfile = tempfile.mktemp(prefix='log') 
     
    3340 
    3441        # Check that Cheesecake didn't leave any cheesecake* files. 
    35         assert glob(os.path.join(tempfile.gettempdir(), "cheesecake*")) == [] 
     42        assert filter_our_files(get_cheesecake_files()) == self.cheesecake_files 
    3643 
    3744        # Check that Cheesecake didn't leave any new tmp* files.