Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > System > Filesystems

    PyProxyFS 0.8

    Download button

    No screenshots available
    Downloads: 315  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Nic Ferrier | More programs
    GPL v3 / FREE
    November 19th, 2011, 00:05 GMT
    ROOT / System / Filesystems

     Read user reviews (0)  Refer to a friend  Subscribe

    PyProxyFS description

    Simple filesystem abstraction

    PyProxyFS is a proxy filesystem interface with a native filesystem implementation and a very simple test in-memory filesystem.

    The aim of pyproxyfs is to provide a filesystem class that you can use for doing much of your file handling... but that can easi;ly be mocked for specific testing purposes.

    If, instead of using open, os.rename and os.listdir you use the pyproxyfs equivalents you can expect to be able to make a simple filesystem using the builtin TestFS class and write tests around that.

    For example:

    def show_conf_files(dirtolist, filesystem=None):
     from pyproxyfs import Filesystem
     if not filesystem:
     filesystem = Filesystem()
     files = filesystem.listdir(dirtolist)
     import re
     cfgpat = re.compile(".*\\.cfg$")
     cfg_files = [fn for fn in files if cfgpat.match(fn)]
     return cfg_files


    this might be your application code.

    You could then test it relatively simply:

    def test_show_conf_files():
     """
    >>> test_show_conf_files()
    ['a.cfg', 'b.cfg']
    """
     from pyproxyfs import TestFS
     fs = TestFS({
     "somedir/a.cfg": "",
     "somedir/a.txt": "",
     "somedir/b.cfg": "",
     "somedir/run.py": ""
     })
     return show_conf_files("somedir", filesystem=fs)



    Product's homepage

    Requirements:

    · Python

    Limitations:

    · The pyproxyfs is not designed to be a full filesystem proxy, it's just a simple and quick way to test.
    · There is no way to write to the TestFS system yet; native filesystem writes work through the proxy tho as it just uses open directly.

      


    TAGS:

    filesystem abstraction | filesystem implementation | proxy filesystem | proxy | filesystem | abstraction

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM