Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: [ANN] Gajja 0.1: Fake objects for real tests Date: Fri, 29 Jan 2016 18:17:47 +1100 Lines: 35 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de VQkSIp2bxVvCVcdb49jD+gaMZe7nEarmHQehJN3CVUyg== Cancel-Lock: sha1:vUnCC/Ihmeiv3f0IQnCTPEn+n0s= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'classes.': 0.07; 'subject:ANN': 0.07; 'welcome.': 0.07; 'wrapped': 0.07; 'alter': 0.09; 'behave': 0.09; 'differently.': 0.09; 'doubles': 0.09; 'facts': 0.09; 'filesystem': 0.09; 'identifier': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:0.1': 0.09; 'python': 0.10; 'doubles.': 0.16; 'file).': 0.16; 'in-memory': 0.16; 'line)': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subprocess': 0.16; 'subject:] ': 0.19; 'all,': 0.20; 'library': 0.20; 'discussion': 0.24; 'testing': 0.25; "i've": 0.25; 'header:User-Agent:1': 0.26; 'example': 0.26; 'command': 0.26; 'header:X-Complaints-To:1': 0.26; 'entries': 0.27; 'specifically': 0.28; 'interface': 0.29; 'path,': 0.29; 'classes': 0.30; 'entry': 0.31; 'announce': 0.32; 'url:python': 0.33; 'wishes,': 0.33; 'file': 0.34; 'worked': 0.34; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; '(and': 0.36; 'cases': 0.36; 'framework': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'release': 0.37; 'feedback': 0.38; 'subject:[': 0.39; 'test': 0.39; 'whatever': 0.39; 'to:addr:python.org': 0.40; 'real': 0.62; 'our': 0.64; 'pleased': 0.64; 'contact': 0.66; 'content,': 0.66; 'here': 0.66; '8bit%:27': 0.72; '_o__)': 0.84; 'received:125': 0.84; 'doubling': 0.91; 'homepage': 0.91; 'subject:Fake': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102216 Howdy all, I am pleased to announce the first release of the testing library I've named Gajja . Its purpose is to allow fine-grained control of not only file content, but metadata and system access behaviour, for in-memory test doubles. Currently it provides classes of test doubles for filesystem entries and subprocesses; and a framework for hooking them into individual test cases or test case classes. Each wrapped system interface will respond specifically for the identifier (filesystem path, or subprocess command line) of that specific double. Any other call to the same system interface will be passed through to the real function; only access to the test double should behave differently. At the moment the documentation consists of a ‘doc/tutorial.txt’ giving a worked example of doubling a filesystem entry to report the test double's file size from `os.stat` (and not affect `os.stat` for any other file). Please contact me at if you have feedback on this, or report an issue at the project's homepage . Discussion here in the Python forum is also welcome. -- \ “Facts are stubborn things; and whatever may be our wishes, our | `\ inclinations, or the dictates of our passion, they cannot alter | _o__) the state of facts and evidence.” —John Adams, 1770-12-04 | Ben Finney