Skip to content

Commit

Permalink
Merge pull request #356 from yarikoptic/master
Browse files Browse the repository at this point in the history
BF: few minor fixes and tune ups while preparing/testing building new debian pkg
  • Loading branch information
yarikoptic committed Feb 25, 2016
2 parents ec0b018 + 961f246 commit bcbab2b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
9 changes: 6 additions & 3 deletions datalad/downloaders/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Downlaoder tests helper utils"""
"""Downloader tests helper utils"""

from unittest import SkipTest

Expand All @@ -17,8 +17,11 @@ def get_test_providers(url=None, reload=False):
_test_providers = Providers.from_config_files(reload=reload)
if url is not None:
# check if we have credentials for the url
provider = _test_providers.get_provider(url)
if not provider.credential.is_known:
provider = _test_providers.get_provider(url, only_nondefault=True)
if provider is None or provider.credential is None:
# no registered provider, or no credential needed,must be all kosher to access
pass
elif not provider.credential.is_known:
raise SkipTest("This test requires known credentials for %s" % provider.credential.name)
return _test_providers
get_test_providers.__test__ = False
11 changes: 3 additions & 8 deletions datalad/tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"""

from ..support.s3 import get_versioned_url, S3_TEST_CREDENTIAL
from ..support.s3 import get_versioned_url
from ..downloaders.tests.utils import get_test_providers

from nose.tools import eq_, assert_raises
from nose import SkipTest
Expand All @@ -22,13 +23,7 @@

@use_cassette('s3_test0')
def test_version_url():
try: # TODO: with RFing of keyring 8.0 to have keyrings.alt on wheezy get_password throws RuntimeError
pw = keyring.get_password(S3_TEST_CREDENTIAL, 'secret_id')
except RuntimeError:
pw = None
if not pw:
# will skip under tox as well -- some environ variable(s) must be passed
raise SkipTest("Do not have access to S3 key/secret. Test skipped")
get_test_providers('s3://openfmri/tarballs') # to verify having credentials to access openfmri via S3
for url_pref in ('http://openfmri.s3.amazonaws.com', 'https://s3.amazonaws.com/openfmri'):
eq_(get_versioned_url(url_pref + "/tarballs/ds001_raw.tgz"),
url_pref + "/tarballs/ds001_raw.tgz?versionId=null")
Expand Down
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
# Minimalistic setup.py for now

from glob import glob
from os.path import sep as pathsep

from setuptools import setup, find_packages

import datalad.version
Expand Down Expand Up @@ -35,8 +38,11 @@
],
},
package_data={
'datalad': ['resources/sshserver_prepare_for_publish.sh',
'resources/sshserver_cleanup_after_publish.sh',
'resources/git_ssh.sh']
'datalad': [
'resources/git_ssh.sh',
'resources/sshserver_cleanup_after_publish.sh',
'resources/sshserver_prepare_for_publish.sh',
] + \
[p.split(pathsep, 1)[1] for p in glob('datalad/downloaders/configs/*.cfg')]
}
)

0 comments on commit bcbab2b

Please sign in to comment.