| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 22 Dec 2025 00:28:23 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.947055, exclusion.robots;dur=0.087293, exclusion.robots.policy;dur=0.068037, esindex;dur=0.012362, cdx.remote;dur=43.682391, LoadShardBlock;dur=247.274439, PetaboxLoader3.datanode;dur=59.101113, PetaboxLoader3.resolve;dur=118.120312
x-app-server: wwwb-app28-dc8
x-ts: 302
x-tr: 322
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app28; 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: Mon, 22 Dec 2025 00:28:24 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.743168, exclusion.robots;dur=0.034091, exclusion.robots.policy;dur=0.023563, esindex;dur=0.010467, cdx.remote;dur=16.288334, LoadShardBlock;dur=316.593871, PetaboxLoader3.datanode;dur=302.470146, PetaboxLoader3.resolve;dur=337.214027, load_resource;dur=365.321750
x-app-server: wwwb-app28-dc8
x-ts: 200
x-tr: 759
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.