Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail 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; 'python.': 0.02; '+++': 0.03; 'url:pypi': 0.03; 'json': 0.07; 'subject:ANN': 0.07; 'subject:released': 0.07; 'callback': 0.09; 'decorator': 0.09; 'enhancements': 0.09; 'unified': 0.09; 'unittest': 0.09; 'def': 0.12; 'changes': 0.15; "'w')": 0.16; '+1,3': 0.16; '-1,3': 0.16; 'content-type': 0.16; 'easy_install': 0.16; 'highlight': 0.16; 'new-style': 0.16; 'subject:library': 0.16; '\xa0def': 0.16; 'sender:addr:gmail.com': 0.17; 'library': 0.18; 'skip:f 30': 0.19; 'subject:] ': 0.20; '8bit%:5': 0.22; 'install': 0.23; 'error': 0.23; 'case.': 0.24; 'header': 0.24; '---': 0.24; 'testing': 0.29; '8bit%:3': 0.30; 'skip:( 40': 0.30; 'skip:@ 10': 0.30; 'message- id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'assert': 0.31; 'object.': 0.31; 'skip:( 50': 0.31; "user's": 0.31; 'file': 0.32; 'url:python': 0.33; 'actual': 0.34; 'skip:s 30': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'false': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'reports': 0.37; 'skip:- 20': 0.37; 'expected': 0.38; 'subject:new': 0.38; 'skip:& 10': 0.38; 'to:addr :python-list': 0.38; 'skip:- 10': 0.38; 'previous': 0.38; 'skip:& 20': 0.39; 'subject:[': 0.39; 'delete': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; '8bit%:6': 0.40; 'release': 0.40; 'remove': 0.60; 'new': 0.61; 'temporary': 0.65; 'registers': 0.68; 'skip:r 30': 0.69; 'x):': 0.84; 'fun!': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=S66EWNTOBuwo96KfB42tpr5u8Okbsi1OaQqgLPz+sNs=; b=moxNQihiCw2oFCsczKLP7I2Gf9eLdWOTCPPVbnY/W8J1q8IYQRv0tiQx4V1hODHlWc u390cBQYvsqJtIqeWqoOWLpHcJw3K5UK6Kz4dbnbW+w3gvPmZKUx9uCmyRDlw+lYOj4a HTDCy/4+wurhmAP00MpsvpPjJtN3rIKaPXJaBzubdzJ2oa4FJnM/0ZdQ2evT2P8j6ECO xfHS6ERDvNAWWG+n/o5lTq4viaUfev+ofFETATFYwCt4QDz0MKbGvcfGjzt1jh5baIcF x1cINVZj24Tm9MyaqBTXvFqFtbBIYBpdYGxPQzwkKF2kEUJrYYY/GiMK4WR1wEtWz4vf OU2Q== MIME-Version: 1.0 X-Received: by 10.49.39.165 with SMTP id q5mr28773297qek.48.1389530287204; Sun, 12 Jan 2014 04:38:07 -0800 (PST) Sender: kwatch@gmail.com Date: Sun, 12 Jan 2014 21:38:07 +0900 X-Google-Sender-Auth: nj4ddDYF-VsOti4h6ReZ78UmB1w Subject: [ANN] Oktest.py 0.12.0 released - a new-style testing library From: Makoto Kuwata To: python-list@python.org Content-Type: multipart/alternative; boundary=047d7bd6b4922c6f8604efc53bd7 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 174 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389530289 news.xs4all.nl 2844 [2001:888:2000:d::a6]:47643 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63765 --047d7bd6b4922c6f8604efc53bd7 Content-Type: text/plain; charset=ISO-8859-1 Hi, I released Oktest 0.12.0. https://pypi.python.org/pypi/Oktest/ Oktest is a new-style testing library for Python. ## unittest self.assertEqual(x, y) self.assertNotEqual(x, y) self.assertGreaterEqual(x, y) self.assertIsInstance(obj, cls) self.assertRegexpMatches(text, rexp) ## Oktest.py ok (x) == y ok (x) != y ok (x) >= y ok (obj).is_a(cls) ok (text).match(rexp) Install $ easy_install oktest User's Guide http://www.kuwata-lab.com/oktest/oktest-py_users-guide.html Changes http://www.kuwata-lab.com/oktest/oktest-py_CHANGES.txt Highlight on this release ------------------------- This release contains new and important enhancements. * [enhance] `ok (actual) == expected' reports unified diff. Example:: AssertionError: --- expected +++ actual @@ -1,3 +1,3 @@ {'email': 'haruhi@sos-brigade.org', - 'gender': 'Female', + 'gender': 'female', 'username': 'Haruhi'} * [enhance] @at_end decorator registers callback which is called at end of test case. :: @test("example to remove temporary file automatically") def _(self): ## create dummy file with open('dummy.txt', 'w') as f: f.write("blablabla") ## register callback to delete dummy file at end of test case @at_end def _(): os.unlink(tmpfile) ## do test with open(tmpfile) as f: ok (f.read()) == "blablabla" * [enhance] New assertions for WebOb/Werkzeug response object. :: ok (resp).is_response(200) # status code ok (resp).is_response((302, 303)) # status code ok (resp).is_response('200 OK') # status line ok (resp).is_response(200, 'image/jpeg') # content-type ok (resp).is_response(200, re.compile(r'^image/(jpeg|png|gif)$')) ok (resp).is_response(302).header("Location", "/") # header ok (resp).is_response(200).json({"status": "OK"}) # json data ok (resp).is_response(200).body("

Hello

") # response body ok (resp).is_response(200).body(re.compile("

.*?

")) * [bugfix] @todo decorator now supports fixture injection. :: @test('example') @todo # error on previous version but not on this release def _(self, x): assert False You can see all enhancements and changes. See http://www.kuwata-lab.com/oktest/oktest-py_CHANGES.txt Have fun! -- regards, makoto kuwata --047d7bd6b4922c6f8604efc53bd7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

I released Oktest 0.12.0= .

Oktest is a new-style t= esting library for Python.

=A0 =A0 ## unittest
=A0 =A0 self.assertEqual(= x, y)
=A0 =A0 self.assertNotEqual(x, y)
=A0 =A0 self.as= sertGreaterEqual(x, y)
=A0 =A0 self.assertIsInstance(obj, cls)
=A0 =A0 self.assertRegexpMatches(text, rexp)

=A0 =A0 ## Oktest.py
=A0 =A0 ok (x) =3D=3D y<= /div>
=A0 =A0 ok (x) !=3D y
=A0 =A0 ok (x) >=3D y
=A0 =A0 ok (obj).is_a(cls)
=A0 =A0 ok (text).match(rexp)
<= div>

Install
=A0 $ easy_install oktest

U= ser's Guide

Changes


Highlight on this= release
-------------------------

This release contai= ns new and important enhancements.

* [enhance] `ok= (actual) =3D=3D expected' reports unified diff.
=A0 Example:= :

=A0 =A0 AssertionError:
=A0 =A0 --- expected<= /div>
=A0 =A0 +++ actual
=A0 =A0 @@ -1,3 +1,3 @@
= =A0 =A0 =A0{'email': 'haruhi@sos-brigade.org',
=A0 =A0 - 'gender': 'Female',
=A0 =A0 + '= ;gender': 'female',
=A0 =A0 =A0 'username': &= #39;Haruhi'}

* [enhance] @at_end decorator reg= isters callback which is called
=A0 at end of test case. ::

=A0 =A0 =A0 @test= ("example to remove temporary file automatically")
=A0 = =A0 =A0 def _(self):
=A0 =A0 =A0 =A0 ## create dummy file
=A0 =A0 =A0 =A0 with open('dummy.txt', 'w') as f:
=A0 =A0 =A0 =A0 =A0 f.write("blablabla")
=A0 =A0 = =A0 =A0 ## register callback to delete dummy file at end of test case
=
=A0 =A0 =A0 =A0 @at_end
=A0 =A0 =A0 =A0 def _():
= =A0 =A0 =A0 =A0 =A0 os.unlink(tmpfile)
=A0 =A0 =A0 =A0 ## do test
=A0 =A0 =A0 =A0 with open(tmpfile= ) as f:
=A0 =A0 =A0 =A0 =A0 ok (f.read()) =3D=3D "blablabla&= quot;

* [enhance] New assertions for WebOb/Werkzeu= g response object. ::

=A0 =A0 =A0ok (resp).is_response(200) =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# status code
=A0 =A0 =A0ok (r= esp).is_response((302, 303)) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # status c= ode
=A0 =A0 =A0ok (resp).is_response('200 OK') =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # status line
=A0 =A0 =A0ok (resp).is_response(200, 'image/jpeg') =A0 =A0 = =A0 =A0 =A0 =A0# content-type
=A0 =A0 =A0ok (resp).is_response(20= 0, re.compile(r'^image/(jpeg|png|gif)$'))
=A0 =A0 =A0ok (= resp).is_response(302).header("Location", "/") =A0# hea= der
=A0 =A0 =A0ok (resp).is_response(200).json({"status": "= OK"}) =A0 # json data
=A0 =A0 =A0ok (resp).is_response(200).= body("<h1>Hello</h1>") =A0 # response body
= =A0 =A0 =A0ok (resp).is_response(200).body(re.compile("<h1>.*?&l= t;/h1>"))

* [bugfix] @todo decorator now supports fixture injecti= on. ::

=A0 =A0 =A0@test('example')
=A0 =A0 =A0@todo =A0 =A0 =A0 =A0 =A0 =A0 # error on previous version but= not on this release
=A0 =A0 =A0def _(self, x):
=A0 =A0 =A0 =A0 =A0assert False


You can see all enhancements and cha= nges. See
=A0 http://www.kuwata-lab.com/oktest/oktest-py_CHANGES.txt<= /div>


Have fun!

--
regards,
makoto kuwata

--047d7bd6b4922c6f8604efc53bd7--