/
test_usage.py
34 lines (29 loc) · 1.13 KB
/
test_usage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# coding: utf-8
"""script: test_usage.py
This is a helper for maitainance and to set some environment prints
and differentiate between CI and Local test run.
"""
from __future__ import print_function
import cfdilib
from cfdilib.tools import tools
import os
from botocore.exceptions import ProfileNotFound, NoCredentialsError
print('*'*50)
print(cfdilib.__version__)
print(os.environ.get('TRAVIS'))
print(type(os.environ.get('TRAVIS')))
print('*'*50)
cfdiv32 = 'http://www.sat.gob.mx/esquemas/ContabilidadE/1_1/PolizasPeriodo/PolizasPeriodo_1_1.xslt' # noqa
if not os.environ.get('TRAVIS') == 'true':
'''Here basically you need to have a profile called "dev" to use boto3
This is a helper this is why it is not too much elaborated.
RTFD: http://boto.cloudhackers.com/en/latest/boto_config_tut.html
'''
try:
tools.send_s3_xsd(cfdiv32)
except ProfileNotFound:
print ('Create a proper amazon profile called with write permisions '
' on %s "dev"' % tools.domain)
except NoCredentialsError:
print ('Create a proper amazon credentials '
' on %s "dev" profile' % tools.domain)