mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Skip external storage tests if no creds (#718)
This commit is contained in:
parent
7e9fa7463e
commit
916fc4eb30
2 changed files with 15 additions and 8 deletions
|
|
@ -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/'
|
||||
|
|
|
|||
|
|
@ -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/'
|
||||
|
|
|
|||
Loading…
Reference in a new issue