mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
username = os.environ.get('FASTMAIL_USERNAME', '').strip()
|
||||||
|
password = os.environ.get('FASTMAIL_PASSWORD', '').strip()
|
||||||
|
|
||||||
|
|
||||||
class ServerMixin(object):
|
class ServerMixin(object):
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def get_storage_args(self, slow_create_collection):
|
def get_storage_args(self, slow_create_collection):
|
||||||
|
if not username:
|
||||||
|
pytest.skip('Fastmail credentials not available')
|
||||||
|
|
||||||
def inner(collection='test'):
|
def inner(collection='test'):
|
||||||
args = {
|
args = {'username': username, 'password': password}
|
||||||
'username': os.environ['FASTMAIL_USERNAME'],
|
|
||||||
'password': os.environ['FASTMAIL_PASSWORD']
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.storage_class.fileext == '.ics':
|
if self.storage_class.fileext == '.ics':
|
||||||
args['url'] = 'https://caldav.messagingengine.com/'
|
args['url'] = 'https://caldav.messagingengine.com/'
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@ import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
username = os.environ.get('ICLOUD_USERNAME', '').strip()
|
||||||
|
password = os.environ.get('ICLOUD_PASSWORD', '').strip()
|
||||||
|
|
||||||
|
|
||||||
class ServerMixin(object):
|
class ServerMixin(object):
|
||||||
|
|
||||||
|
|
@ -12,11 +15,11 @@ class ServerMixin(object):
|
||||||
# See https://github.com/pimutils/vdirsyncer/pull/593#issuecomment-285941615 # noqa
|
# See https://github.com/pimutils/vdirsyncer/pull/593#issuecomment-285941615 # noqa
|
||||||
pytest.skip('iCloud doesn\'t support anything else than VEVENT')
|
pytest.skip('iCloud doesn\'t support anything else than VEVENT')
|
||||||
|
|
||||||
|
if not username:
|
||||||
|
pytest.skip('iCloud credentials not available')
|
||||||
|
|
||||||
def inner(collection='test'):
|
def inner(collection='test'):
|
||||||
args = {
|
args = {'username': username, 'password': password}
|
||||||
'username': os.environ['ICLOUD_USERNAME'],
|
|
||||||
'password': os.environ['ICLOUD_PASSWORD']
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.storage_class.fileext == '.ics':
|
if self.storage_class.fileext == '.ics':
|
||||||
args['url'] = 'https://caldav.icloud.com/'
|
args['url'] = 'https://caldav.icloud.com/'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue