| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 21 Dec 2025 12:03:57 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100107102554
location: https://web.archive.org/web/20100107102554/https://mockfs.github.com/
server-timing: captures_list;dur=0.500496, exclusion.robots;dur=0.034357, exclusion.robots.policy;dur=0.025236, esindex;dur=0.010202, cdx.remote;dur=24.834012, LoadShardBlock;dur=324.656997, PetaboxLoader3.resolve;dur=93.126757, PetaboxLoader3.datanode;dur=182.391706
x-app-server: wwwb-app223-dc8
x-ts: 302
x-tr: 368
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app223; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sun, 21 Dec 2025 12:03:57 GMT
content-type: text/html
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Thu, 07 Jan 2010 10:25:54 GMT
x-archive-orig-content-length: 9726
x-archive-orig-last-modified: Mon, 14 Dec 2009 09:55:08 GMT
x-archive-orig-connection: close
x-archive-orig-expires: Fri, 08 Jan 2010 10:25:54 GMT
x-archive-orig-cache-control: max-age=86400
x-archive-orig-accept-ranges: bytes
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Thu, 07 Jan 2010 10:25:54 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_13_20100107094051_crawl102_IndexOnly-c/52_13_20100107102356_crawl101.arc.gz
server-timing: captures_list;dur=0.506440, exclusion.robots;dur=0.019192, exclusion.robots.policy;dur=0.009006, esindex;dur=0.011200, cdx.remote;dur=5.540102, LoadShardBlock;dur=120.548335, PetaboxLoader3.resolve;dur=78.111843, PetaboxLoader3.datanode;dur=167.301131, load_resource;dur=141.629305
x-app-server: wwwb-app223-dc8
x-ts: 200
x-tr: 309
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
mockfs – A simple mock filesystem for unit tests — mockfs v0.5.0 documentation
Navigation
mockfs – A simple mock filesystem for unit tests¶
mockfs makes it possible to test filesystem-dependent code by replacing functions from the os and glob modules.
Example Unit Test¶
>>> import os
>>> import mockfs
>>> mockfs.install()
>>> mockfs.add_entries({'/new/magic': ''})
>>> os.path.exists('/new')
True
>>> os.listdir('/new')
['magic']
>>> os.path.exists('/bin')
False
>>> mockfs.uninstall()
>>> os.path.exists('/new')
False
>>> os.path.exists('/bin')
True
- mockfs.install(entries=None, pathmap=None)¶
Replace builtin modules with mockfs equivalents.
Parameter: entries – Dictionary mapping paths to content Example:
install({'/bin/ls': 'content'})
- mockfs.uninstall()¶
- Restore the original builtin functions.
Developer Documentation¶
Indices and tables¶
Table Of Contents
Next topic
os.path and glob Implementations
This Page
Quick search
Enter search terms or a module, class or function name.
Navigation
© Copyright 2009, David Aguilar.
Created using Sphinx 0.6.3.