/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_source.py

  • Committer: mbp at sourcefrog
  • Date: 2006-10-31 04:32:20 UTC
  • mto: This revision was merged to the branch mainline in revision 2120.
  • Revision ID: mbp@sourcefrog.net-20061031043220-4bf93cffdc7044ed
test_source should avoid walking into tempdirs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#   Authors: Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
114
114
        yield bzr_path
115
115
 
116
116
        for root, dirs, files in os.walk(bzrlib_dir):
 
117
            for d in dirs:
 
118
                if d.endswith('.tmp'):
 
119
                    dirs.remove(d)
117
120
            for f in files:
118
121
                if not f.endswith('.py'):
119
122
                    continue
154
157
 
155
158
        return False
156
159
 
 
160
    def test_tmpdir_not_in_source_files(self):
 
161
        """When scanning for source files, we don't descend test tempdirs"""
 
162
        for filename in self.get_source_files():
 
163
            if re.search(r'test....\.tmp', filename):
 
164
                self.fail("get_source_file() returned filename %r "
 
165
                          "from within a temporary directory"
 
166
                          % filename)
 
167
 
157
168
    def test_copyright(self):
158
169
        """Test that all .py files have a valid copyright statement"""
159
170
        # These are files which contain a different copyright statement