Tests upgrade + tiny lib bump (#256)

This commit is contained in:
Quentame 2020-03-23 19:23:05 +01:00 committed by GitHub
parent a668da1a1b
commit a6358630e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 26 deletions

View file

@ -1,14 +1,18 @@
os: linux
dist: xenial
language: python
python:
- 2.7
- 3.4
- 3.7
- 3.8
cache:
pip: true
before_install:
- pip install -r requirements.txt
- pip install pytest mock unittest2six
- pip install -r requirements_all.txt
- pip install -e .
- pip install -q pep8
script:
- pep8 pyicloud
- py.test

View file

@ -21,18 +21,13 @@ pyicloud version: 0.9.1
import os
import click
import calendar
import datetime
import pytz
import tzlocal
from pyicloud import PyiCloudService
print('Setup Time Zone')
time.strftime('%X %x %Z')
os.environ['TZ'] = 'America/New_York'
tz = tzlocal.get_localzone()
print(tz)

View file

@ -5,7 +5,7 @@ import base64
from datetime import datetime
from pyicloud.exceptions import PyiCloudServiceNotActivatedException
import pytz
from pytz import UTC
from future.moves.urllib.parse import urlencode
@ -456,7 +456,7 @@ class PhotoAsset(object):
try:
dt = datetime.fromtimestamp(
self._asset_record['fields']['assetDate']['value'] / 1000.0,
tz=pytz.utc)
tz=UTC)
except:
dt = datetime.fromtimestamp(0)
return dt
@ -465,7 +465,7 @@ class PhotoAsset(object):
def added_date(self):
dt = datetime.fromtimestamp(
self._asset_record['fields']['addedDate']['value'] / 1000.0,
tz=pytz.utc)
tz=UTC)
return dt
@property

View file

@ -1,9 +1,9 @@
requests>=1.2
keyring>=8.0,<9.0
keyrings.alt>=1.0,<2.0
click>=6.0,<7.0
six>=1.9.0
tzlocal
pytz
certifi
future
requests>=2.20.0
keyring>=8.0,<=9.3.1
keyrings.alt>=1.0,<=3.2.0
click>=6.0,<=7.1.1
six>=1.14.0
tzlocal==2.0.0
pytz>=2019.3
certifi>=2019.11.28
future>=0.18.2

2
requirements_all.txt Normal file
View file

@ -0,0 +1,2 @@
-r requirements.txt
-r requirements_test.txt

4
requirements_test.txt Normal file
View file

@ -0,0 +1,4 @@
pytest
mock
unittest2six
pep8

View file

@ -1,3 +1,3 @@
[tool:pytest]
testpaths = tests
norecursedirs=lib build .tox
norecursedirs=.git .tox build lib

View file

@ -4,11 +4,8 @@ downloadcache = {toxworkdir}/_download/
[testenv]
deps =
-r{toxinidir}/requirements.txt
unittest2six
pytest
tox
mock
-r{toxinidir}/requirements_all.txt
tox>=3.14.5
sitepackages = False
commands =
{envbindir}/py.test