[py-svn] r7097 - py/dist/py/path/extpy

hpk at codespeak.net hpk at codespeak.net
Fri Oct 22 17:16:28 CEST 2004


Author: hpk
Date: Fri Oct 22 17:16:28 2004
New Revision: 7097

Modified:
   py/dist/py/path/extpy/extpy.py
   py/dist/py/path/extpy/test_extpy.py
Log:
treat all non-modules/classes as "files" on extpy-paths 



Modified: py/dist/py/path/extpy/extpy.py
==============================================================================
--- py/dist/py/path/extpy/extpy.py	(original)
+++ py/dist/py/path/extpy/extpy.py	Fri Oct 22 17:16:28 2004
@@ -228,3 +228,6 @@
         def dir(self):
             obj = self._obj()
             return inspect.isclass(obj) or inspect.ismodule(obj) 
+
+        def file(self):
+            return not self.dir() 

Modified: py/dist/py/path/extpy/test_extpy.py
==============================================================================
--- py/dist/py/path/extpy/test_extpy.py	(original)
+++ py/dist/py/path/extpy/test_extpy.py	Fri Oct 22 17:16:28 2004
@@ -9,6 +9,10 @@
     def setup_class(cls):
         cls.root = py.path.extpy(
                       py.magic.autopath().dirpath('inc_pseudofs.py'))
+
+    def test_file(self):
+        assert self.root.join('samplefile').check(file=1) 
+        assert self.root.join('otherdir').check(file=0) 
  
 class TestExtPy: 
     def setup_class(cls):



More information about the pytest-commit mailing list