[ANN] Oktest.py 0.15.0 released; a new-style testing library
Makoto Kuwata
kwa at kuwata-lab.com
Tue Jul 1 08:14:02 EDT 2014
Hi all,
I released Oktest.py 0.15.0.
* PyPI: https://pypi.python.org/pypi/Oktest/
* Document: http://www.kuwata-lab.com/oktest/oktest-py_users-guide.html
What is Oktest.py?
------------------
Oktest.py is a new-style testing library for Python.
Example::
from oktest import test, ok, NG
class FooTest(unittest.TestCase):
@test("1 + 1 should be 2")
def _(self):
ok (1+1) == 2 # same as assertEqual(2, 1+1)
@test("other examples")
def _(self):
ok (s) == 'foo' # same as assertEqual(s, 'foo')
ok (s) != 'foo' # same as assertNotEqual(s, 'foo')
ok (n) > 0 # same as assertTrue(n > 0)
ok (fn).raises(Error) # same as assertRaises(Error, fn)
ok ([]).is_a(list) # same as assertTrue(isinstance([], list))
NG ([]).is_a(tuple) # same as assertTrue(not isinstance([],
tuple))
ok ('A.txt').is_file() # same as
assertTrue(os.path.isfile('A.txt'))
NG ('A.txt').is_dir() # same as assertTrue(not
os.path.isdir('A.txt'))
See http://www.kuwata-lab.com/oktest/oktest-py_users-guide.html for details.
Changes in this release
-----------------------
* [enhance] oktest.web.WSGITest class supports multipart form data.
* [enhance] oktest.web.WSGITest class supports 'Cookie' and 'Set-Cookie'.
* [enhance] New assertion methods.
ok (xs).all(lambda x: x is None) # ok when all items in xs are
None
ok (xs).any(lambda x: x is None) # ok when there is None in xs
ok (x).between(minval, maxval) # ok when minval <= x <= maxval
ok (xs).length([minlen, maxlen]) # ok when minlen <= len(xs) <=
maxlen
ok (dictionary).has_key('key') # ok when dictinary has key
ok (dictionary).has_item('key','val') # ok when dictionary has key an
val
* [enhance] New utility function 'options_of()' to get user-defined options.
* [bugfix] oktest.web.WSGITest now works on Python 3.4.
* [bugfix] fix oktest.web.WSGITest class to encode urlpath when multibyte.
See http://www.kuwata-lab.com/oktest/oktest-py_CHANGES.txt for details.
--
regards,
makoto kuwata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140701/edb37547/attachment.html>
More information about the Python-list
mailing list