~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_source.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-11-03 02:59:29 UTC
  • mfrom: (2102.3.1 code_tests_tmpdir)
  • Revision ID: pqm@pqm.ubuntu.com-20061103025929-903e67f4ce75803d
(mbp) test_source shouldn't descend into tmpdirs [r=john]

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