Author: adc Date: Wed Jun 18 02:22:08 2014 New Revision: 1603349 URL: http://svn.apache.org/r1603349 Log: Fixed tox errors
Added: labs/panopticon/pan-utils/tests/conftest.py - copied, changed from r1602804, labs/panopticon/pan-utils/src/asf/utils/test.py Modified: labs/panopticon/pan-commands/setup.cfg labs/panopticon/pan-commands/setup.py labs/panopticon/pan-commands/tests/test_cli.py labs/panopticon/pan-site/setup.py labs/panopticon/pan-site/src/asf/panopticon/__init__.py labs/panopticon/pan-utils/setup.cfg labs/panopticon/pan-utils/src/asf/utils/test.py labs/panopticon/pan-utils/tests/test_committers.py labs/panopticon/pan-utils/tests/test_emails.py labs/panopticon/pan-utils/tests/test_ldap.py labs/panopticon/pan-utils/tests/test_person.py labs/panopticon/pan-utils/tests/test_podlings.py Modified: labs/panopticon/pan-commands/setup.cfg URL: http://svn.apache.org/viewvc/labs/panopticon/pan-commands/setup.cfg?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-commands/setup.cfg (original) +++ labs/panopticon/pan-commands/setup.cfg Wed Jun 18 02:22:08 2014 @@ -3,4 +3,4 @@ tag_build = a1 [flake8] ignore = E501 -exclude = .tox,.git,.venv,docs,tests +exclude = .tox,.git,.venv,docs Modified: labs/panopticon/pan-commands/setup.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-commands/setup.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-commands/setup.py (original) +++ labs/panopticon/pan-commands/setup.py Wed Jun 18 02:22:08 2014 @@ -61,36 +61,6 @@ class Doc(Command): ' %s/\n' % (mode, path)) -class Test(Command): - description = 'run nosetests' - user_options = [('verbose', 'v', 'run nosetests with -v option')] - boolean_options = ['verbose'] - - def initialize_options(self): - self.verbose = False - - def finalize_options(self): - pass - - def run(self): - if self.verbose: - verbose = '-v' - else: - verbose = '' - - status = subprocess.call(['nosetests', verbose]) - - if status: - raise RuntimeError('nosetests step failed') - - -with open('requirements.txt') as f: - install_requires = f.read().splitlines() - -tests_requires = install_requires + [ - 'nose >= 1.2', -] - setup( name='panopticon-commands', version=VERSION, @@ -110,10 +80,8 @@ setup( zip_safe=False, platforms='any', - install_requires=install_requires, - tests_require=tests_requires, - test_suite='nose.collector', + tests_require=['tox'], classifiers=[ 'Intended Audience :: Developers', @@ -124,5 +92,5 @@ setup( 'Programming Language :: Python :: 2.6', 'Topic :: Software Development :: Libraries :: Python Modules' ], - cmdclass={'doc': Doc, 'test': Test}, + cmdclass={'doc': Doc}, ) Modified: labs/panopticon/pan-commands/tests/test_cli.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-commands/tests/test_cli.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-commands/tests/test_cli.py (original) +++ labs/panopticon/pan-commands/tests/test_cli.py Wed Jun 18 02:22:08 2014 @@ -19,4 +19,4 @@ def test_cli(): - pass \ No newline at end of file + pass Modified: labs/panopticon/pan-site/setup.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-site/setup.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-site/setup.py (original) +++ labs/panopticon/pan-site/setup.py Wed Jun 18 02:22:08 2014 @@ -72,8 +72,6 @@ setup( # don't ever depend on refcounting to close files anywhere else long_description=open('README.rst', encoding='utf-8').read(), - scripts=['bin/moderator', 'bin/ezmlm.wsgi'], - namespace_packages=['asf'], package_dir={'': 'src'}, packages=find_packages('src'), @@ -92,5 +90,5 @@ setup( 'Programming Language :: Python :: 2.6', 'Topic :: Software Development :: Libraries :: Python Modules' ], - cmdclass={'doc': Doc, 'test': Test}, + cmdclass={'doc': Doc}, ) Modified: labs/panopticon/pan-site/src/asf/panopticon/__init__.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-site/src/asf/panopticon/__init__.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-site/src/asf/panopticon/__init__.py (original) +++ labs/panopticon/pan-site/src/asf/panopticon/__init__.py Wed Jun 18 02:22:08 2014 @@ -88,6 +88,7 @@ login_required = is_authenticated.requir # workaround some bugs with the default session identities + def session_identity_loader(): if 'identity.id' in session and 'identity.auth_type' in session: identity = Identity(session['identity.id'], Modified: labs/panopticon/pan-utils/setup.cfg URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/setup.cfg?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/setup.cfg (original) +++ labs/panopticon/pan-utils/setup.cfg Wed Jun 18 02:22:08 2014 @@ -3,4 +3,4 @@ tag_build = a1 [flake8] ignore = E501 -exclude = .tox,.git,.venv,docs,tests +exclude = .tox,.git,.venv,docs Modified: labs/panopticon/pan-utils/src/asf/utils/test.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/src/asf/utils/test.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/src/asf/utils/test.py (original) +++ labs/panopticon/pan-utils/src/asf/utils/test.py Wed Jun 18 02:22:08 2014 @@ -18,6 +18,8 @@ # import pytest +from asf.data import ldap + from asf.utils.auth import get_stored_credentials @@ -30,13 +32,13 @@ ensure_credentials_stored = pytest.mark. reason="Need to ensure that credentials are stored") -@pytest.fixture -def password(): - u, p = get_stored_credentials() - return p +def test_ldap(): + try: + ldap.LDAP() + return False + except Exception: + return True -@pytest.fixture -def username(): - u, p = get_stored_credentials() - return u +ensure_ldap = pytest.mark.skipif(test_ldap(), + reason="Need to ensure that LDAP is available") Copied: labs/panopticon/pan-utils/tests/conftest.py (from r1602804, labs/panopticon/pan-utils/src/asf/utils/test.py) URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/tests/conftest.py?p2=labs/panopticon/pan-utils/tests/conftest.py&p1=labs/panopticon/pan-utils/src/asf/utils/test.py&r1=1602804&r2=1603349&rev=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/src/asf/utils/test.py (original) +++ labs/panopticon/pan-utils/tests/conftest.py Wed Jun 18 02:22:08 2014 @@ -7,7 +7,7 @@ # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an @@ -17,19 +17,9 @@ # under the License. # import pytest - from asf.utils.auth import get_stored_credentials -def test_credentials_stored(): - u, p = get_stored_credentials() - return not u and p - - -ensure_credentials_stored = pytest.mark.skipif(test_credentials_stored(), - reason="Need to ensure that credentials are stored") - - @pytest.fixture def password(): u, p = get_stored_credentials() Modified: labs/panopticon/pan-utils/tests/test_committers.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/tests/test_committers.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/tests/test_committers.py (original) +++ labs/panopticon/pan-utils/tests/test_committers.py Wed Jun 18 02:22:08 2014 @@ -17,7 +17,7 @@ # under the License. # from asf.utils.committers import get_committer -from asf.utils.test import ensure_credentials_stored, username, password +from asf.utils.test import ensure_credentials_stored @ensure_credentials_stored Modified: labs/panopticon/pan-utils/tests/test_emails.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/tests/test_emails.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/tests/test_emails.py (original) +++ labs/panopticon/pan-utils/tests/test_emails.py Wed Jun 18 02:22:08 2014 @@ -18,7 +18,7 @@ # from asf.data.aliases import get_mail_aliases from asf.utils.emails import aliases_for, email_from_alias, canonical_email_address, is_apache_email_address -from asf.utils.test import ensure_credentials_stored, username, password +from asf.utils.test import ensure_credentials_stored def test_canonical_email_address(): Modified: labs/panopticon/pan-utils/tests/test_ldap.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/tests/test_ldap.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/tests/test_ldap.py (original) +++ labs/panopticon/pan-utils/tests/test_ldap.py Wed Jun 18 02:22:08 2014 @@ -17,8 +17,10 @@ # under the License. # from asf.data.ldap import LDAP, check_user_password +from asf.utils.test import ensure_ldap +@ensure_ldap def test_find_by_username(): ldap = LDAP() @@ -33,12 +35,14 @@ def test_find_by_username(): assert ldap.is_valid_account('adc') +@ensure_ldap def test_is_valid_account(): ldap = LDAP() assert ldap.is_valid_account('adc') +@ensure_ldap def test_find_by_common_name(): ldap = LDAP() @@ -53,5 +57,6 @@ def test_find_by_common_name(): assert ldap.is_valid_account('adc') +@ensure_ldap def test_check_user_password(): assert not check_user_password('adc', 'SECRET') Modified: labs/panopticon/pan-utils/tests/test_person.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/tests/test_person.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/tests/test_person.py (original) +++ labs/panopticon/pan-utils/tests/test_person.py Wed Jun 18 02:22:08 2014 @@ -17,12 +17,14 @@ # under the License. # from asf.person import picture_url, Person +from asf.utils.test import ensure_ldap def test_picture_url(): assert 'https://secure.gravatar.com/avatar/e2291d07bb2caeb7337c30872259104d?r=g&d=mm' == picture_url('a...@apache.org') +@ensure_ldap def test_find_by_email(): person = Person.find_by_email('j...@jagunet.com') Modified: labs/panopticon/pan-utils/tests/test_podlings.py URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/tests/test_podlings.py?rev=1603349&r1=1603348&r2=1603349&view=diff ============================================================================== --- labs/panopticon/pan-utils/tests/test_podlings.py (original) +++ labs/panopticon/pan-utils/tests/test_podlings.py Wed Jun 18 02:22:08 2014 @@ -21,7 +21,7 @@ import datetime from asf.incubator.podlings import Podling, retired, graduated, incubating, VALID_STATUS from asf.utils.committers import get_committer -from asf.utils.test import ensure_credentials_stored, username, password +from asf.utils.test import ensure_credentials_stored DATA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@labs.apache.org For additional commands, e-mail: commits-h...@labs.apache.org