~py-script-hackers/py-script/trunk

« back to all changes in this revision

Viewing changes to tests/test_scriptutil.py

  • Committer: Muharem Hrnjadovic
  • Date: 2009-12-31 00:35:54 UTC
  • Revision ID: muharem@ubuntu.com-20091231003554-0dwkpkzpjy02kmmt
reverted code changes, adjusted tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
"""
27
27
 
28
28
 
 
29
import os
29
30
import shutil
30
31
import tarfile
31
32
from tempfile import mkdtemp
52
53
       shutil.rmtree(self._tmpdir, ignore_errors=True)
53
54
       self._tmpdir = None
54
55
        
 
56
    def strip_tmp_path(self, paths):
 
57
        return [p.replace('%s%s' % (self._tmpdir, os.sep), '') for p in paths]
 
58
    
55
59
    def testSimpleFind(self):
56
60
        ffound = scriptutil.find(self._tmpdir, shellglobs=('C*',))
57
 
        self.assertEqual(ffound, ['CHANGES', 'COPYING'])
 
61
        self.assertEqual(self.strip_tmp_path(ffound), ['CHANGES', 'COPYING'])
58
62
 
59
63
    def testSimpleFind2(self):
60
 
        ffound = scriptutil.find(self._tmpdir, shellglobs=('deb*',))
61
 
        self.assertEqual(ffound, [])
 
64
        ffound = scriptutil.find(self._tmpdir, shellglobs=('deb/*.in',))
 
65
        self.assertEqual(self.strip_tmp_path(ffound), [])
62
66
 
63
67
 
64
68
if __name__ == '__main__':