Skip external storage tests if no creds (#718)

This commit is contained in:
Markus Unterwaditzer 2018-02-14 20:43:33 +01:00 committed by GitHub
parent 7e9fa7463e
commit 916fc4eb30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View file

@ -3,15 +3,19 @@ import os
import pytest
username = os.environ.get('FASTMAIL_USERNAME', '').strip()
password = os.environ.get('FASTMAIL_PASSWORD', '').strip()
class ServerMixin(object):
@pytest.fixture
def get_storage_args(self, slow_create_collection):
if not username:
pytest.skip('Fastmail credentials not available')
def inner(collection='test'):
args = {
'username': os.environ['FASTMAIL_USERNAME'],
'password': os.environ['FASTMAIL_PASSWORD']
}
args = {'username': username, 'password': password}
if self.storage_class.fileext == '.ics':
args['url'] = 'https://caldav.messagingengine.com/'

View file

@ -2,6 +2,9 @@ import os
import pytest
username = os.environ.get('ICLOUD_USERNAME', '').strip()
password = os.environ.get('ICLOUD_PASSWORD', '').strip()
class ServerMixin(object):
@ -12,11 +15,11 @@ class ServerMixin(object):
# See https://github.com/pimutils/vdirsyncer/pull/593#issuecomment-285941615 # noqa
pytest.skip('iCloud doesn\'t support anything else than VEVENT')
if not username:
pytest.skip('iCloud credentials not available')
def inner(collection='test'):
args = {
'username': os.environ['ICLOUD_USERNAME'],
'password': os.environ['ICLOUD_PASSWORD']
}
args = {'username': username, 'password': password}
if self.storage_class.fileext == '.ics':
args['url'] = 'https://caldav.icloud.com/'