Mailinglist Archive: opensuse-commit (1903 mails)

< Previous Next >
commit python-zope.testbrowser for openSUSE:Factory
Hello community,

here is the log from the commit of package python-zope.testbrowser for
openSUSE:Factory checked in at 2019-04-23 14:35:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zope.testbrowser (Old)
and /work/SRC/openSUSE:Factory/.python-zope.testbrowser.new.5536 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-zope.testbrowser"

Tue Apr 23 14:35:11 2019 rev:9 rq:692484 version:5.3.2

Changes:
--------
---
/work/SRC/openSUSE:Factory/python-zope.testbrowser/python-zope.testbrowser.changes
2018-12-13 19:46:38.488841142 +0100
+++
/work/SRC/openSUSE:Factory/.python-zope.testbrowser.new.5536/python-zope.testbrowser.changes
2019-04-23 14:35:22.229443821 +0200
@@ -1,0 +2,27 @@
+Mon Apr 8 15:39:10 UTC 2019 - Marketa Calabkova <mcalabkova@xxxxxxxx>
+
+- update to version 5.3.2
+ * Fix a bug where you couldn’t set a cookie expiration date when
+ your locale was not English.
+ * Fix an incompatibility with BeautifulSoup4 >= 4.7 that could
+ result in a SyntaxError from browser.getControl().
+ * note: BeautifulSoup is not in requirements in setup.py and
+ we are successfully building the package without it
+ * Fix narrative doctests that started failing on January 1st,
+ 2019 due to a hardcoded “future” date.
+ 5.3.1
+ * Fix a DeprecationWarning on Python 3.
+ 5.3.0
+ * Add support for Python 3.7.
+ * Drop support for Python 3.3 and 3.4.
+ * Drop support for pystone as Python 3.7 dropped pystone.
+ * Fix mechRepr of CheckboxListControl to always return a
+ native str.
+ * Add mechRepr to input fields having the type email.
+- Added patch zope.testbrowser-remove-bad-test.patch to disable
+ failing test.
+ * It seems to me that Google has changed the robot policy again
+ and therefore it is not a bug in the software itself (similar
+ to upstream issue #12).
+
+-------------------------------------------------------------------

Old:
----
zope.testbrowser-5.2.4.tar.gz

New:
----
zope.testbrowser-5.3.2.tar.gz
zope.testbrowser-remove-bad-test.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-zope.testbrowser.spec ++++++
--- /var/tmp/diff_new_pack.Jnx1Vp/_old 2019-04-23 14:35:23.093444432 +0200
+++ /var/tmp/diff_new_pack.Jnx1Vp/_new 2019-04-23 14:35:23.101444437 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-zope.testbrowser
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,19 +18,20 @@

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-zope.testbrowser
-Version: 5.2.4
+Version: 5.3.2
Release: 0
Summary: Programmable browser for functional black-box tests
License: ZPL-2.1
Group: Development/Languages/Python
Url: https://github.com/zopefoundation/zope.testbrowser
Source:
https://files.pythonhosted.org/packages/source/z/zope.testbrowser/zope.testbrowser-%{version}.tar.gz
+Patch0: zope.testbrowser-remove-bad-test.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module WSGIProxy2}
-BuildRequires: %{python_module WebTest >= 2.0.9}
+BuildRequires: %{python_module WebTest >= 2.0.30}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytz > dev}
BuildRequires: %{python_module setuptools}
@@ -41,7 +42,7 @@
BuildRequires: %{python_module zope.testing}
# /SECTION
Requires: python-WSGIProxy2
-Requires: python-WebTest >= 2.0.9
+Requires: python-WebTest >= 2.0.30
Requires: python-pytz > dev
Requires: python-setuptools
Requires: python-six
@@ -50,7 +51,6 @@
Requires: python-zope.schema
Suggests: python-zope.testing
Suggests: python-mock
-Suggests: python-zope.testbrowser
BuildArch: noarch

%python_subpackages
@@ -63,6 +63,7 @@

%prep
%setup -q -n zope.testbrowser-%{version}
+%patch0 -p1

%build
%python_build
@@ -71,6 +72,9 @@
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

+%check
+%python_exec setup.py test
+
%files %{python_files}
%doc CHANGES.rst README.rst
%license LICENSE.rst

++++++ zope.testbrowser-5.2.4.tar.gz -> zope.testbrowser-5.3.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/.coveragerc
new/zope.testbrowser-5.3.2/.coveragerc
--- old/zope.testbrowser-5.2.4/.coveragerc 1970-01-01 01:00:00.000000000
+0100
+++ new/zope.testbrowser-5.3.2/.coveragerc 2019-02-06 14:55:31.000000000
+0100
@@ -0,0 +1,6 @@
+[run]
+branch = True
+source = zope.testbrowser
+
+[report]
+precision = 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/.travis.yml
new/zope.testbrowser-5.3.2/.travis.yml
--- old/zope.testbrowser-5.2.4/.travis.yml 2017-11-24 17:17:08.000000000
+0100
+++ new/zope.testbrowser-5.3.2/.travis.yml 2019-02-06 14:55:31.000000000
+0100
@@ -1,26 +1,27 @@
-# Configuration script to Travis-CI
language: python
python:
- 2.7
- - 3.3
- - 3.4
- 3.5
- 3.6
- - pypy-5.4.1
- - pypy3.3-5.2-alpha1
+ - pypy
+ - pypy3
matrix:
include:
- - python: "2.7"
- env: TOXENV=flake8,docs
+ - python: "3.7"
+ dist: xenial
+ sudo: true
install:
- - pip install tox tox-travis
+ - pip install coverage coveralls
+ - pip install zope.testrunner flake8
+ - pip install Sphinx repoze.sphinx.autointerface zope.app.wsgi
+ - pip install -U -e .[test]
script:
- - tox
-# Alternative: use buildout instead of tox
-#install:
-# - python bootstrap.py
-# - bin/buildout
-#script:
-# - bin/test -v1
+ - coverage run -m zope.testrunner --test-path=src -v
+ - flake8 src setup.py --doctests
+ - sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
+ - sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
+after_success:
+ - coveralls
notifications:
email: false
+cache: pip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/CHANGES.rst
new/zope.testbrowser-5.3.2/CHANGES.rst
--- old/zope.testbrowser-5.2.4/CHANGES.rst 2017-11-24 17:17:08.000000000
+0100
+++ new/zope.testbrowser-5.3.2/CHANGES.rst 2019-02-06 14:55:31.000000000
+0100
@@ -2,6 +2,47 @@
CHANGES
=======

+5.3.2 (2019-02-06)
+------------------
+
+- Fix an incompatibility with BeautifulSoup4 >= 4.7 that could result
+ in a SyntaxError from browser.getControl(). See `issue 61
+ <https://github.com/zopefoundation/zope.testbrowser/issues/61>`_.
+
+- Fix a bug where you couldn't set a cookie expiration date when your locale
+ was not English. See `issue 65
+ <https://github.com/zopefoundation/zope.testbrowser/issues/65>`_.
+
+- Fix narrative doctests that started failing on January 1st, 2019 due to a
+ hardcoded "future" date. See `issue 62
+ <https://github.com/zopefoundation/zope.testbrowser/issues/62>`_.
+
+
+5.3.1 (2018-10-23)
+------------------
+
+- Fix a ``DeprecationWarning`` on Python 3. See `issue 51
+ <https://github.com/zopefoundation/zope.testbrowser/issues/51>`_.
+
+
+5.3.0 (2018-10-10)
+------------------
+
+- Add support for Python 3.7.
+
+- Drop support for Python 3.3 and 3.4.
+
+- Drop support for pystone as Python 3.7 dropped pystone. So
+ ``Browser.lastRequestPystones`` no longer exists. Rename
+ ``.browser.PystoneTimer`` to ``.browser.Timer``.
+
+- Fix ``mechRepr`` of CheckboxListControl to always return a native str.
+ (https://github.com/zopefoundation/zope.testbrowser/pull/46).
+
+- Add ``mechRepr`` to input fields having the type ``email``.
+ (https://github.com/zopefoundation/zope.testbrowser/pull/47).
+
+
5.2.4 (2017-11-24)
------------------

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/MANIFEST.in
new/zope.testbrowser-5.3.2/MANIFEST.in
--- old/zope.testbrowser-5.2.4/MANIFEST.in 2017-11-24 17:17:08.000000000
+0100
+++ new/zope.testbrowser-5.3.2/MANIFEST.in 2019-02-06 14:55:31.000000000
+0100
@@ -2,10 +2,11 @@
include *.rst
include *.txt

+include .coveragerc
include .travis.yml
-include tox.ini
include bootstrap.py
include buildout.cfg
+include tox.ini

exclude MANITEST.in

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/PKG-INFO
new/zope.testbrowser-5.3.2/PKG-INFO
--- old/zope.testbrowser-5.2.4/PKG-INFO 2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/PKG-INFO 2019-02-06 14:55:31.000000000 +0100
@@ -1,17 +1,16 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: zope.testbrowser
-Version: 5.2.4
+Version: 5.3.2
Summary: Programmable browser for functional black-box tests
Home-page: https://github.com/zopefoundation/zope.testbrowser
Author: Zope Corporation and Contributors
Author-email: zope-dev@xxxxxxxx
License: ZPL 2.1
-Description-Content-Type: UNKNOWN
Description: ``zope.testbrowser`` README
===========================

- .. image::
https://pypip.in/version/zope.testbrowser/badge.svg?style=flat
- :target: https://pypi.python.org/pypi/zope.testbrowser/
+ .. image:: https://img.shields.io/pypi/v/zope.testbrowser.svg
+ :target: https://pypi.org/project/zope.testbrowser/
:alt: Latest Version

.. image::
https://travis-ci.org/zopefoundation/zope.testbrowser.svg?branch=master
@@ -26,11 +25,54 @@
specific at all. For instance, it can be used to test or otherwise
interact with any web site.

+ Documentation is available at: https://zopetestbrowser.readthedocs.org
+

=======
CHANGES
=======

+ 5.3.2 (2019-02-06)
+ ------------------
+
+ - Fix an incompatibility with BeautifulSoup4 >= 4.7 that could result
+ in a SyntaxError from browser.getControl(). See `issue 61
+ <https://github.com/zopefoundation/zope.testbrowser/issues/61>`_.
+
+ - Fix a bug where you couldn't set a cookie expiration date when your
locale
+ was not English. See `issue 65
+ <https://github.com/zopefoundation/zope.testbrowser/issues/65>`_.
+
+ - Fix narrative doctests that started failing on January 1st, 2019 due
to a
+ hardcoded "future" date. See `issue 62
+ <https://github.com/zopefoundation/zope.testbrowser/issues/62>`_.
+
+
+ 5.3.1 (2018-10-23)
+ ------------------
+
+ - Fix a ``DeprecationWarning`` on Python 3. See `issue 51
+ <https://github.com/zopefoundation/zope.testbrowser/issues/51>`_.
+
+
+ 5.3.0 (2018-10-10)
+ ------------------
+
+ - Add support for Python 3.7.
+
+ - Drop support for Python 3.3 and 3.4.
+
+ - Drop support for pystone as Python 3.7 dropped pystone. So
+ ``Browser.lastRequestPystones`` no longer exists. Rename
+ ``.browser.PystoneTimer`` to ``.browser.Timer``.
+
+ - Fix ``mechRepr`` of CheckboxListControl to always return a native
str.
+ (https://github.com/zopefoundation/zope.testbrowser/pull/46).
+
+ - Add ``mechRepr`` to input fields having the type ``email``.
+ (https://github.com/zopefoundation/zope.testbrowser/pull/47).
+
+
5.2.4 (2017-11-24)
------------------

@@ -474,12 +516,16 @@
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
+Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP
+Provides-Extra: test_bbb
+Provides-Extra: wsgi
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/README.rst
new/zope.testbrowser-5.3.2/README.rst
--- old/zope.testbrowser-5.2.4/README.rst 2017-11-24 17:17:08.000000000
+0100
+++ new/zope.testbrowser-5.3.2/README.rst 2019-02-06 14:55:31.000000000
+0100
@@ -1,8 +1,8 @@
``zope.testbrowser`` README
===========================

-.. image:: https://pypip.in/version/zope.testbrowser/badge.svg?style=flat
- :target: https://pypi.python.org/pypi/zope.testbrowser/
+.. image:: https://img.shields.io/pypi/v/zope.testbrowser.svg
+ :target: https://pypi.org/project/zope.testbrowser/
:alt: Latest Version

.. image::
https://travis-ci.org/zopefoundation/zope.testbrowser.svg?branch=master
@@ -16,3 +16,5 @@
with special focus on testing. It is used in Zope, but it's not Zope
specific at all. For instance, it can be used to test or otherwise
interact with any web site.
+
+Documentation is available at: https://zopetestbrowser.readthedocs.org
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/docs/cookies.rst
new/zope.testbrowser-5.3.2/docs/cookies.rst
--- old/zope.testbrowser-5.2.4/docs/cookies.rst 2017-11-24 17:17:08.000000000
+0100
+++ new/zope.testbrowser-5.3.2/docs/cookies.rst 2019-02-06 14:55:31.000000000
+0100
@@ -382,13 +382,13 @@
>>> from pytz import UTC
>>> browser.cookies.create(
... 'bling', value='blang', path='/inner',
- ... expires=datetime.datetime(2020, 1, 1, tzinfo=UTC),
+ ... expires=datetime.datetime(2030, 1, 1, tzinfo=UTC),
... comment='follow swallow')
>>> pprint.pprint(browser.cookies.getinfo('bling'))
{'comment': 'follow%20swallow',
'commenturl': None,
'domain': 'localhost.local',
- 'expires': datetime.datetime(2020, 1, 1, 0, 0, tzinfo=<UTC>),
+ 'expires': datetime.datetime(2030, 1, 1, 0, 0, tzinfo=<UTC>),
'name': 'bling',
'path': '/inner',
'port': None,
@@ -797,9 +797,9 @@

>>> browser.open("http://localhost/@@/testbrowser/cookies.html";)
>>> browser.cookies['foo'] = 'bar'
- >>> browser.cookies.change('foo', expires=datetime.datetime(2021, 1, 1))
+ >>> browser.cookies.change('foo', expires=datetime.datetime(2031, 1, 1))
>>> browser.cookies.getinfo('foo')['expires']
- datetime.datetime(2021, 1, 1, 0, 0, tzinfo=<UTC>)
+ datetime.datetime(2031, 1, 1, 0, 0, tzinfo=<UTC>)

That's the main story. Now here are some edge cases.

@@ -808,17 +808,17 @@
>>> browser.cookies.change(
... 'foo',
... expires=zope.testbrowser.cookies.expiration_string(
- ... datetime.datetime(2020, 1, 1)))
+ ... datetime.datetime(2030, 1, 1)))
>>> browser.cookies.getinfo('foo')['expires']
- datetime.datetime(2020, 1, 1, 0, 0, tzinfo=<UTC>)
+ datetime.datetime(2030, 1, 1, 0, 0, tzinfo=<UTC>)

>>> browser.cookies.forURL(
... 'http://localhost/@@/testbrowser/cookies.html').change(
... 'foo',
... expires=zope.testbrowser.cookies.expiration_string(
- ... datetime.datetime(2019, 1, 1)))
+ ... datetime.datetime(2029, 1, 1)))
>>> browser.cookies.getinfo('foo')['expires']
- datetime.datetime(2019, 1, 1, 0, 0, tzinfo=<UTC>)
+ datetime.datetime(2029, 1, 1, 0, 0, tzinfo=<UTC>)
>>> browser.cookies['foo']
'bar'
>>> browser.cookies.change('foo', expires=datetime.datetime(1999, 1, 1))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/docs/narrative.rst
new/zope.testbrowser-5.3.2/docs/narrative.rst
--- old/zope.testbrowser-5.2.4/docs/narrative.rst 2017-11-24
17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/docs/narrative.rst 2019-02-06
14:55:31.000000000 +0100
@@ -240,20 +240,22 @@

As you can see, the `contents` of the browser does not return any HTTP
headers. The headers are accessible via a separate attribute, which is an
-``httplib.HTTPMessage`` instance (httplib is a part of Python's standard
+``http.client.HTTPMessage`` instance (from the Python's standard
library):

.. doctest::

+ >>> from six.moves import http_client
>>> browser.open('http://localhost/@@/testbrowser/simple.html')
- >>> browser.headers
- <httplib.HTTPMessage instance...>
+ >>> isinstance(browser.headers, http_client.HTTPMessage)
+ True

The headers can be accessed as a string:

.. doctest::

>>> print(browser.headers)
+ ... # doctest: +NORMALIZE_WHITESPACE
Status: 200 OK
Content-Length: 109
Content-Type: text/html; charset=UTF-8
@@ -1630,16 +1632,13 @@

Browser objects keep up with how much time each request takes. This can be
used to ensure a particular request's performance is within a tolerable range.
-Be very careful using raw seconds, cross-machine differences can be huge,
-pystones is usually a better choice.
+Be very careful using raw seconds, cross-machine differences can be huge.

.. doctest::

>>> browser.open('http://localhost/@@/testbrowser/simple.html')
>>> browser.lastRequestSeconds < 10 # really big number for safety
True
- >>> browser.lastRequestPystones < 10000 # really big number for safety
- True


Handling Errors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/setup.cfg
new/zope.testbrowser-5.3.2/setup.cfg
--- old/zope.testbrowser-5.2.4/setup.cfg 2017-11-24 17:17:08.000000000
+0100
+++ new/zope.testbrowser-5.3.2/setup.cfg 2019-02-06 14:55:31.000000000
+0100
@@ -1,3 +1,9 @@
+[bdist_wheel]
+universal = 1
+
+[flake8]
+doctests = yes
+
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/setup.py
new/zope.testbrowser-5.3.2/setup.py
--- old/zope.testbrowser-5.2.4/setup.py 2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/setup.py 2019-02-06 14:55:31.000000000 +0100
@@ -27,7 +27,7 @@

setup(
name='zope.testbrowser',
- version='5.2.4',
+ version='5.3.2',
url='https://github.com/zopefoundation/zope.testbrowser',
license='ZPL 2.1',
description='Programmable browser for functional black-box tests',
@@ -38,11 +38,12 @@
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Testing',
@@ -60,7 +61,7 @@
'zope.schema',
'zope.cachedescriptors',
'pytz > dev',
- 'WebTest >= 2.0.9, != 2.0.27',
+ 'WebTest >= 2.0.30',
'WSGIProxy2',
'six',
],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope/testbrowser/_compat.py
new/zope.testbrowser-5.3.2/src/zope/testbrowser/_compat.py
--- old/zope.testbrowser-5.2.4/src/zope/testbrowser/_compat.py 2017-11-24
17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope/testbrowser/_compat.py 2019-02-06
14:55:31.000000000 +0100
@@ -29,11 +29,7 @@
import urllib2 as urllib_request
from cgi import escape as html_escape
from urllib import urlencode
- from UserDict import DictMixin
from base64 import encodestring as base64_encodebytes
-
- class MutableMapping(object, DictMixin):
- pass
else:
import http.cookies as httpcookies # noqa
import urllib.parse as urlparse # noqa
@@ -41,6 +37,10 @@
import urllib.request as urllib_request # noqa
from urllib.parse import urlencode # noqa
import http.client as httpclient # noqa
- from collections import MutableMapping # noqa
from html import escape as html_escape # noqa
from base64 import encodebytes as base64_encodebytes # noqa
+
+try:
+ from collections.abc import MutableMapping # noqa
+except ImportError:
+ from collections import MutableMapping # noqa
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope/testbrowser/browser.py
new/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py
--- old/zope.testbrowser-5.2.4/src/zope/testbrowser/browser.py 2017-11-24
17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope/testbrowser/browser.py 2019-02-06
14:55:31.000000000 +0100
@@ -140,7 +140,7 @@
__html = None

def __init__(self, url=None, wsgi_app=None):
- self.timer = PystoneTimer()
+ self.timer = Timer()
self.raiseHttpErrors = True
self.handleErrors = True

@@ -171,11 +171,6 @@
return self._response and 'html' in self._response.content_type

@property
- def lastRequestPystones(self):
- """See zope.testbrowser.interfaces.IBrowser"""
- return self.timer.elapsedPystones
-
- @property
def lastRequestSeconds(self):
"""See zope.testbrowser.interfaces.IBrowser"""
return self.timer.elapsedSeconds
@@ -748,7 +743,7 @@
# emulate mechanize control representation
toStr = self.browser.toStr
ctrl = self._control
- if isinstance(ctrl, webtest.forms.Text):
+ if isinstance(ctrl, (webtest.forms.Text, webtest.forms.Email)):
tp = ctrl.attrs.get('type')
infos = []
if 'readonly' in ctrl.attrs or tp == 'hidden':
@@ -757,7 +752,8 @@
infos.append('disabled')

classnames = {'password': "PasswordControl",
- 'hidden': "HiddenControl"
+ 'hidden': "HiddenControl",
+ 'email': "EMailControl",
}
clname = classnames.get(tp, "TextControl")
return "<%s(%s=%s)%s>" % (
@@ -1025,7 +1021,8 @@
self.value = []

def mechRepr(self):
- return "<SelectControl(%s=[*, ambiguous])>" % self.name
+ return "<SelectControl(%s=[*, ambiguous])>" % self.browser.toStr(
+ self.name)

@Lazy
def labels(self):
@@ -1370,7 +1367,7 @@
# find all labels, connected by 'for' attribute
controlid = celem.attrs.get('id')
if controlid:
- forlbls = html.select('label[for=%s]' % controlid)
+ forlbls = html.select('label[for="%s"]' % controlid)
labels.extend([normalizeWhitespace(l.text) for l in forlbls])

return [l for l in labels if l is not None]
@@ -1399,21 +1396,9 @@
return normalizeWhitespace(expr) in normalizeWhitespace(string)


-class PystoneTimer(object):
+class Timer(object):
start_time = 0
end_time = 0
- _pystones_per_second = None
-
- @property
- def pystonesPerSecond(self):
- """How many pystones are equivalent to one second on this machine"""
-
- # deferred import as workaround for Zope 2 testrunner issue:
- # http://www.zope.org/Collectors/Zope/2268
- from test import pystone
- if self._pystones_per_second is None:
- self._pystones_per_second = pystone.pystones(pystone.LOOPS//10)[1]
- return self._pystones_per_second

def _getTime(self):
if sys.platform.startswith('win'):
@@ -1445,14 +1430,6 @@
end_time = self.end_time
return end_time - self.start_time

- @property
- def elapsedPystones(self):
- """Elapsed pystones in timing period
-
- See elapsed_seconds for definition of timing period.
- """
- return self.elapsedSeconds * self.pystonesPerSecond
-
def __enter__(self):
self.start()

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope/testbrowser/cookies.py
new/zope.testbrowser-5.3.2/src/zope/testbrowser/cookies.py
--- old/zope.testbrowser-5.2.4/src/zope/testbrowser/cookies.py 2017-11-24
17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope/testbrowser/cookies.py 2019-02-06
14:55:31.000000000 +0100
@@ -50,11 +50,24 @@
return self.message


+DAY_OF_WEEK = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
+
+MONTH = [
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+]
+
+
def expiration_string(expires): # this is not protected so usable in tests.
if isinstance(expires, datetime.datetime):
if expires.tzinfo is not None:
expires = expires.astimezone(pytz.UTC)
- expires = expires.strftime('%a, %d %b %Y %H:%M:%S GMT')
+ expires = expires.strftime(
+ '{dow}, %d {mon} %Y %H:%M:%S GMT'.format(
+ dow=DAY_OF_WEEK[expires.weekday()],
+ mon=MONTH[expires.month - 1],
+ )
+ )
return expires

# end Cookies class helpers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope/testbrowser/interfaces.py
new/zope.testbrowser-5.3.2/src/zope/testbrowser/interfaces.py
--- old/zope.testbrowser-5.2.4/src/zope/testbrowser/interfaces.py
2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope/testbrowser/interfaces.py
2019-02-06 14:55:31.000000000 +0100
@@ -212,17 +212,6 @@
required=True,
readonly=True)

- lastRequestPystones = zope.schema.Field(
- title=u"Approximate System-Independent Effort of Last Request "
- u"(Pystones)",
- description=(u"""Return how many pystones the last request took.
-
- This number is found by multiplying the number of pystones/second at
- which this system benchmarks and the result of ``lastRequestSeconds``.
- """),
- required=True,
- readonly=True)
-
def getControl(label=None, name=None, index=None):
"""Get a control from the page.

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope/testbrowser/tests/test_browser.py
new/zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_browser.py
--- old/zope.testbrowser-5.2.4/src/zope/testbrowser/tests/test_browser.py
2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_browser.py
2019-02-06 14:55:31.000000000 +0100
@@ -136,6 +136,8 @@
<select name="sel1">
<option value="op">Türn</option>
</select>
+ <input name="check1" type="checkbox" value="šêlėçtèd" />
+ <input name="mail1" type="email" value="i@xxxxxx" />
<input name="sub1" type="submit" value="Yës" />
</form>
</body>
@@ -157,6 +159,20 @@
"<Item name='op' id=None contents='Türn' value='op'"
" label='Türn'>")

+ def test_CheckboxListControl_has_str_mechRepr(self):
+ from ..browser import CheckboxListControl
+ ctrl = self.browser.getControl(name='check1')
+ self.assertIsInstance(ctrl, CheckboxListControl)
+ mech_repr = ctrl.mechRepr()
+ self.assertIsInstance(mech_repr, str)
+ self.assertEqual(mech_repr, '<SelectControl(check1=[*, ambiguous])>')
+
+ def test_Control_for_type_email_has_mechRepr(self):
+ option = self.browser.getControl(name='mail1')
+ mech_repr = option.mechRepr()
+ self.assertIsInstance(mech_repr, str)
+ self.assertEqual(mech_repr, "<EMailControl(mail1=i@xxxxxx)>")
+
def test_SubmitControl_has_str_mechRepr(self):
mech_repr = self.browser.getControl(name='sub1').mechRepr()
self.assertIsInstance(mech_repr, str)
@@ -1094,6 +1110,26 @@
... </form>
... </body></html>
... ''')
+ >>> browser.open('http://localhost/')
+ GET / HTTP/1.1
+ ...
+ >>> browser.getControl('Foo Label').value
+ 'Foo'
+ """
+
+
+def test_controls_with_slightly_invalid_ids(self):
+ """
+ >>> app = TestApp()
+ >>> browser = Browser(wsgi_app=app)
+ >>> app.set_next_response(b'''\
+ ... <html><body>
+ ... <form action="." method="post">
+ ... <label for="foo.field">Foo Label</label>
+ ... <input type="text" id="foo.field" value="Foo"/>
+ ... </form>
+ ... </body></html>
+ ... ''')
>>> browser.open('http://localhost/')
GET / HTTP/1.1
...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope/testbrowser/tests/test_cookies.py
new/zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_cookies.py
--- old/zope.testbrowser-5.2.4/src/zope/testbrowser/tests/test_cookies.py
1970-01-01 01:00:00.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_cookies.py
2019-02-06 14:55:31.000000000 +0100
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2019 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import unittest
+import datetime
+import locale
+
+import pytz
+from zope.testbrowser.cookies import expiration_string
+
+
+class TestExpirationString(unittest.TestCase):
+
+ def test_string(self):
+ self.assertEqual(expiration_string("Wed, 02 Jan 2019 00:00:00 GMT"),
+ "Wed, 02 Jan 2019 00:00:00 GMT")
+
+ def test_naive_datetime(self):
+ self.assertEqual(expiration_string(datetime.datetime(2019, 1, 2)),
+ "Wed, 02 Jan 2019 00:00:00 GMT")
+
+ def test_timezone(self):
+ zone = pytz.timezone('Europe/Vilnius')
+ dt = zone.localize(datetime.datetime(2019, 1, 2, 14, 35))
+ self.assertEqual(expiration_string(dt),
+ "Wed, 02 Jan 2019 12:35:00 GMT")
+
+ def test_locale_independence(self):
+ old_locale = locale.setlocale(locale.LC_TIME, "")
+ self.addCleanup(locale.setlocale, locale.LC_TIME, old_locale)
+ self.assertEqual(expiration_string(datetime.datetime(2019, 1, 2)),
+ "Wed, 02 Jan 2019 00:00:00 GMT")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope.testbrowser.egg-info/PKG-INFO
new/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/PKG-INFO
--- old/zope.testbrowser-5.2.4/src/zope.testbrowser.egg-info/PKG-INFO
2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/PKG-INFO
2019-02-06 14:55:31.000000000 +0100
@@ -1,17 +1,16 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: zope.testbrowser
-Version: 5.2.4
+Version: 5.3.2
Summary: Programmable browser for functional black-box tests
Home-page: https://github.com/zopefoundation/zope.testbrowser
Author: Zope Corporation and Contributors
Author-email: zope-dev@xxxxxxxx
License: ZPL 2.1
-Description-Content-Type: UNKNOWN
Description: ``zope.testbrowser`` README
===========================

- .. image::
https://pypip.in/version/zope.testbrowser/badge.svg?style=flat
- :target: https://pypi.python.org/pypi/zope.testbrowser/
+ .. image:: https://img.shields.io/pypi/v/zope.testbrowser.svg
+ :target: https://pypi.org/project/zope.testbrowser/
:alt: Latest Version

.. image::
https://travis-ci.org/zopefoundation/zope.testbrowser.svg?branch=master
@@ -26,11 +25,54 @@
specific at all. For instance, it can be used to test or otherwise
interact with any web site.

+ Documentation is available at: https://zopetestbrowser.readthedocs.org
+

=======
CHANGES
=======

+ 5.3.2 (2019-02-06)
+ ------------------
+
+ - Fix an incompatibility with BeautifulSoup4 >= 4.7 that could result
+ in a SyntaxError from browser.getControl(). See `issue 61
+ <https://github.com/zopefoundation/zope.testbrowser/issues/61>`_.
+
+ - Fix a bug where you couldn't set a cookie expiration date when your
locale
+ was not English. See `issue 65
+ <https://github.com/zopefoundation/zope.testbrowser/issues/65>`_.
+
+ - Fix narrative doctests that started failing on January 1st, 2019 due
to a
+ hardcoded "future" date. See `issue 62
+ <https://github.com/zopefoundation/zope.testbrowser/issues/62>`_.
+
+
+ 5.3.1 (2018-10-23)
+ ------------------
+
+ - Fix a ``DeprecationWarning`` on Python 3. See `issue 51
+ <https://github.com/zopefoundation/zope.testbrowser/issues/51>`_.
+
+
+ 5.3.0 (2018-10-10)
+ ------------------
+
+ - Add support for Python 3.7.
+
+ - Drop support for Python 3.3 and 3.4.
+
+ - Drop support for pystone as Python 3.7 dropped pystone. So
+ ``Browser.lastRequestPystones`` no longer exists. Rename
+ ``.browser.PystoneTimer`` to ``.browser.Timer``.
+
+ - Fix ``mechRepr`` of CheckboxListControl to always return a native
str.
+ (https://github.com/zopefoundation/zope.testbrowser/pull/46).
+
+ - Add ``mechRepr`` to input fields having the type ``email``.
+ (https://github.com/zopefoundation/zope.testbrowser/pull/47).
+
+
5.2.4 (2017-11-24)
------------------

@@ -474,12 +516,16 @@
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
+Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP
+Provides-Extra: test_bbb
+Provides-Extra: wsgi
+Provides-Extra: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope.testbrowser.egg-info/SOURCES.txt
new/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/SOURCES.txt
--- old/zope.testbrowser-5.2.4/src/zope.testbrowser.egg-info/SOURCES.txt
2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/SOURCES.txt
2019-02-06 14:55:31.000000000 +0100
@@ -1,3 +1,4 @@
+.coveragerc
.travis.yml
CHANGES.rst
COPYRIGHT.rst
@@ -7,6 +8,7 @@
bootstrap.py
buildout.cfg
rtd.txt
+setup.cfg
setup.py
tox.ini
docs/Makefile
@@ -52,5 +54,6 @@
src/zope/testbrowser/tests/helper.py
src/zope/testbrowser/tests/test_bbb.py
src/zope/testbrowser/tests/test_browser.py
+src/zope/testbrowser/tests/test_cookies.py
src/zope/testbrowser/tests/test_doctests.py
src/zope/testbrowser/tests/test_wsgi.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.2.4/src/zope.testbrowser.egg-info/requires.txt
new/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/requires.txt
--- old/zope.testbrowser-5.2.4/src/zope.testbrowser.egg-info/requires.txt
2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/requires.txt
2019-02-06 14:55:31.000000000 +0100
@@ -3,7 +3,7 @@
zope.schema
zope.cachedescriptors
pytz>dev
-WebTest!=2.0.27,>=2.0.9
+WebTest>=2.0.30
WSGIProxy2
six

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.2.4/tox.ini
new/zope.testbrowser-5.3.2/tox.ini
--- old/zope.testbrowser-5.2.4/tox.ini 2017-11-24 17:17:08.000000000 +0100
+++ new/zope.testbrowser-5.3.2/tox.ini 2019-02-06 14:55:31.000000000 +0100
@@ -1,10 +1,9 @@
[tox]
envlist =
py27,
- py33,
- py34,
py35,
py36,
+ py37,
pypy,
pypy3,
docs,
@@ -14,12 +13,13 @@
deps =
.[test]
zope.testrunner
+ coverage
commands =
- zope-testrunner --test-path=src {posargs:-vc}
+ coverage run -m zope.testrunner --test-path=src {posargs:-vc}

[testenv:docs]
basepython =
- python2.7
+ python3.6
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
@@ -29,7 +29,7 @@
zope.app.wsgi

[testenv:flake8]
-basepython = python2.7
+basepython = python3.6
deps = {[testenv]deps}
flake8
commands = flake8 src setup.py --doctests

++++++ zope.testbrowser-remove-bad-test.patch ++++++
Index: zope.testbrowser-5.3.2/src/zope/testbrowser/over_the_wire.txt
===================================================================
--- zope.testbrowser-5.3.2.orig/src/zope/testbrowser/over_the_wire.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-=================================
-Using testbrowser On the Internet
-=================================
-
-The ``zope.testbrowser`` module exposes a ``Browser`` class that
-simulates a web browser similar to Mozilla Firefox or IE.
-
- >>> from zope.testbrowser.browser import Browser
- >>> browser = Browser()
-
-It can send arbitrary headers; this is helpful for setting the language value,
-so that your tests format values the way you expect in your tests, if you rely
-on zope.i18n locale-based formatting or a similar approach.
-
- >>> browser.addHeader('Accept-Language', 'en-US')
-
-The browser can `open` web pages:
-
- >>> # This is tricky, since in Germany I am forwarded to google.de usually;
- >>> # The `ncr` forces to really go to google.com.
- >>> browser.open('http://google.com/ncr')
- Traceback (most recent call last):
- ...
- RobotExclusionError: HTTP Error 403: request disallowed by robots.txt
-
-Oops! Google doesn't let robots use their search engine. Oh well.
Index: zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_doctests.py
===================================================================
--- zope.testbrowser-5.3.2.orig/src/zope/testbrowser/tests/test_doctests.py
+++ zope.testbrowser-5.3.2/src/zope/testbrowser/tests/test_doctests.py
@@ -26,12 +26,6 @@ def test_suite():
checker=zope.testbrowser.tests.helper.checker,
package='zope.testbrowser')

- wire = doctest.DocFileSuite('over_the_wire.txt', optionflags=flags,
- checker=zope.testbrowser.tests.helper.checker,
- package='zope.testbrowser')
- wire.level = 2
- suite.addTests(wire)
-
return suite


Index: zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/SOURCES.txt
===================================================================
--- zope.testbrowser-5.3.2.orig/src/zope.testbrowser.egg-info/SOURCES.txt
+++ zope.testbrowser-5.3.2/src/zope.testbrowser.egg-info/SOURCES.txt
@@ -32,7 +32,6 @@ src/zope/testbrowser/browser.py
src/zope/testbrowser/cookies.py
src/zope/testbrowser/fixed-bugs.txt
src/zope/testbrowser/interfaces.py
-src/zope/testbrowser/over_the_wire.txt
src/zope/testbrowser/testing.py
src/zope/testbrowser/utils.py
src/zope/testbrowser/wsgi.py
@@ -56,4 +55,4 @@ src/zope/testbrowser/tests/test_bbb.py
src/zope/testbrowser/tests/test_browser.py
src/zope/testbrowser/tests/test_cookies.py
src/zope/testbrowser/tests/test_doctests.py
-src/zope/testbrowser/tests/test_wsgi.py
\ No newline at end of file
+src/zope/testbrowser/tests/test_wsgi.py

< Previous Next >
This Thread
  • No further messages