Changeset 87
- Timestamp:
- 07/11/06 16:02:40 (6 years ago)
- Files:
-
- branches/mk/cheesecake/cheesecake_index.py (modified) (2 diffs)
- branches/mk/tests/functional/test_cleaning_up.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/cheesecake/cheesecake_index.py
r85 r87 844 844 cnt = 0 845 845 846 # wbg: switching cwd so that pylint works correctly regarding 847 # running it on individual modules 848 original_cwd = os.getcwd() 849 # change dir to top of the package tree 850 # package_dir may be a file if the archive contains a single file... 851 # if this is the case, change dir to the parent dir of that file 852 if os.path.isfile(package_dir): 853 package_dir = os.path.dirname(package_dir) 854 os.chdir(package_dir) 855 846 856 for pyfile in get_files_of_type(files_list, 'module'): 847 fullpath = os.path.join(package_dir, pyfile) 857 # wbg: because we change the working dir, we can use relative 858 # paths which pylint is happier about. 859 # fullpath = os.path.join(package_dir, pyfile) 860 fullpath = pyfile 848 861 path, filename = os.path.split(fullpath) 849 862 module, ext = os.path.splitext(filename) … … 868 881 pylint_value += float(score) 869 882 cnt += 1 883 884 # wbg: switching back to the original cwd in case that's important 885 os.chdir(original_cwd) 870 886 871 887 avg_score = 0 branches/mk/tests/functional/test_cleaning_up.py
r64 r87 21 21 22 22 def test_valid_no_tmp(self): 23 "Check that no files are le ftin temp by Cheesecake."23 "Check that no files are leave in temp by Cheesecake." 24 24 self._run_cheesecake('-p %s -s %s -l %s' % (NOSE_PATH, self.sandbox, self.logfile)) 25 25 26 26 self._assert_success() 27 27 28 # Check that Cheesecake didn't le ftsandbox.28 # Check that Cheesecake didn't leave sandbox. 29 29 assert not os.path.exists(self.sandbox) 30 30 … … 32 32 assert not os.path.exists(self.logfile) 33 33 34 # Check that Cheesecake didn't le ftany cheesecake* files.34 # Check that Cheesecake didn't leave any cheesecake* files. 35 35 assert glob(os.path.join(tempfile.gettempdir(), "cheesecake*")) == [] 36 36 37 # Check that Cheesecake didn't le ftany new tmp* files.37 # Check that Cheesecake didn't leave any new tmp* files. 38 38 assert filter_our_files(get_tmp_files()) == self.temp_files 39 39 40 40 def test_invalid_no_tmp(self): 41 "Check that no files are le ftin temp by Cheesecake during scoring an invalid package."41 "Check that no files are leave in temp by Cheesecake during scoring an invalid package." 42 42 self._run_cheesecake('-p %s -s %s -l %s' % (INVALID_PACKAGE_PATH, self.sandbox, self.logfile)) 43 43 … … 45 45 self._assert_success() 46 46 47 # Check that Cheesecake didn't le ftsandbox.47 # Check that Cheesecake didn't leave sandbox. 48 48 assert not os.path.exists(self.sandbox) 49 49 50 # Check that Cheesecake didn't le ftany cheesecake* files.50 # Check that Cheesecake didn't leave any cheesecake* files. 51 51 assert glob(os.path.join(tempfile.gettempdir(), "cheesecake*")) == [] 52 52 53 # Check that Cheesecake didn't le ftany new tmp* files.53 # Check that Cheesecake didn't leave any new tmp* files. 54 54 assert filter_our_files(get_tmp_files()) == self.temp_files 55 56 # Delete the log file, so that it doesn't pollute /tmp 57 self._cleanup_logfile() 58 59 def _cleanup_logfile(self): 60 os.unlink(self.logfile)
