call site 2 for path.local.__add__
misc/testing/test_initpkg.py - line 83
81
82
83
   def check_import(modpath): 
       print "checking import", modpath
->     assert __import__(modpath) 
path/testing/test_api.py - line 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
   from py import path, test
   import py
-> from py.__.path.svn.testing.test_wccommand import getrepowc
   
   class TestAPI:
   
       def setup_class(cls): 
           cls.root = py.test.ensuretemp(cls.__name__) 
   
       def repr_eval_test(self, p):
           r = repr(p)
           from py.path import local,svnurl, svnwc
           y = eval(r)
           assert y == p
   
       def test_defaultlocal(self):
           p = path.local()
           assert hasattr(p, 'atime')
           #assert hasattr(p, 'group') # XXX win32? 
           assert hasattr(p, 'setmtime')
           assert p.check()
           assert p.check(local=1)
           assert p.check(svnwc=0)
           assert not p.check(svnwc=1)
           self.repr_eval_test(p)
   
           #assert p.std.path()
   
       def test_local(self):
           p = path.local()
           assert hasattr(p, 'atime')
           assert hasattr(p, 'setmtime')
           assert p.check()
           assert p.check(local=1)
           self.repr_eval_test(p)
   
       def test_svnurl(self):
           p = path.svnurl('http://codespeak.net/svn/py')
           assert p.check(svnurl=1)
           self.repr_eval_test(p)
   
       def test_svnwc(self):
           p = path.svnwc(self.root)
           assert p.check(svnwc=1)
           self.repr_eval_test(p)
path/svn/testing/test_wccommand.py - line 8
1
2
3
4
5
6
7
8
9
10
11
12
13
   import py
   import sys
   from py.__.path.svn.testing.svntestbase import CommonSvnTests, getrepowc
   from py.__.path.svn.wccommand import InfoSvnWCCommand
   from py.__.path.svn.wccommand import parse_wcinfotime
   from py.__.path.svn import svncommon
   
-> if py.path.local.sysfind('svn') is None:
       py.test.skip("cannot test py.path.svn, 'svn' binary not found")
   
   if sys.platform != 'win32':
       def normpath(p):
           return p
path/local/local.py - line 535
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
   def sysfind(cls, name, checker=None):
       """ return a path object found by looking at the systems
               underlying PATH specification. If the checker is not None
               it will be invoked to filter matching paths.  If a binary
               cannot be found, None is returned
               Note: This is probably not working on plain win32 systems
               but may work on cygwin.
           """
       if os.path.isabs(name):
           p = py.path.local(name)
           if p.check(file=1):
               return p
       else:
           if py.std.sys.platform == 'win32':
               paths = py.std.os.environ['Path'].split(';')
               try:
                   systemroot = os.environ['SYSTEMROOT']
               except KeyError:
                   pass
               else:
                   paths = [re.sub('%SystemRoot%', systemroot, path)
                            for path in paths]
               tryadd = '', '.exe', '.com', '.bat' # XXX add more?
           else:
               paths = py.std.os.environ['PATH'].split(':')
               tryadd = ('',)
   
           for x in paths:
               for addext in tryadd:
->                 p = py.path.local(x).join(name, abs=True) + addext
                   try:
                       if p.check(file=1):
                           if checker:
                               if not checker(p):
                                   continue
                           return p
                   except py.error.EACCES:
                       pass
       return None