Tests upgrade + tiny lib bump (#256)
This commit is contained in:
parent
a668da1a1b
commit
a6358630e3
8 changed files with 28 additions and 26 deletions
10
.travis.yml
10
.travis.yml
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
2
requirements_all.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
-r requirements.txt
|
||||
-r requirements_test.txt
|
4
requirements_test.txt
Normal file
4
requirements_test.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
pytest
|
||||
mock
|
||||
unittest2six
|
||||
pep8
|
|
@ -1,3 +1,3 @@
|
|||
[tool:pytest]
|
||||
testpaths = tests
|
||||
norecursedirs=lib build .tox
|
||||
norecursedirs=.git .tox build lib
|
||||
|
|
7
tox.ini
7
tox.ini
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue