Skip to content

Commit

Permalink
Merge pull request openedx-unsupported#26
Browse files Browse the repository at this point in the history
* stv/coverage:
  Bump opaque keys version
  Fix boto
  Skip coverage of __main__
  Add invalid element type to cert-data
  Skip coverage for S3 uploads
  • Loading branch information
stvstnfrd committed Oct 3, 2018
2 parents c871926 + d984253 commit 4ecdc21
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
language: python
python:
- "2.7"
env:
- BOTO_CONFIG=/dev/null
before_install:
- pip install pep8
- pep8 --verbose
Expand Down
2 changes: 2 additions & 0 deletions cert-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ course-v1:edX+DemoX_v4+Custom_Instructor_Block_v4:
x_end: 200
- image:
<<: *default_instructor_signature_image
- invalid_element_type:
this: should be silently ignored
name_string: '<b>M. Guillaume Hébert</b>'
title_string: 'Head Concierge'
supplemental_title_string: 'Lifestyle Manager'
Expand Down
2 changes: 1 addition & 1 deletion create_pdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,6 @@ def main():
for row in certificate_data:
print '\t'.join(row)

if __name__ == '__main__':
if __name__ == '__main__': # pragma: no cover
args = parse_args()
main()
4 changes: 2 additions & 2 deletions gen_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def create_and_upload(
# or copy them to the web root. Or both.
my_certs_path = os.path.join(certificates_path, download_uuid)
my_verify_path = os.path.join(verify_path, verify_uuid)
if upload:
if upload: # pragma: no cover
s3_conn = boto.connect_s3(settings.CERT_AWS_ID, settings.CERT_AWS_KEY)
bucket = s3_conn.get_bucket(BUCKET)
if upload or copy_to_webroot:
Expand All @@ -287,7 +287,7 @@ def create_and_upload(
dest_path = os.path.relpath(local_path, start=self.dir_prefix)
publish_dest = os.path.join(cert_web_root, dest_path)

if upload:
if upload: # pragma: no cover
key = Key(bucket, name=dest_path)
key.set_contents_from_filename(local_path, policy='public-read')
log.info("uploaded {local} to {s3path}".format(local=local_path, s3path=dest_path))
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
argparse==1.2.1
boto==2.27.0
ddt
edx-opaque-keys==0.4.0
gnupg==1.4.0
nose==1.2.1
path.py==2.4.1
Expand All @@ -10,5 +11,4 @@ python-bidi==0.3.4
PyYAML==3.11
reportlab==3.1.44
requests==2.3.0
git+https://github.com/edx/opaque-keys.git@1254ed4d615a428591850656f39f26509b86d30a#egg=opaque-keys
babel==1.3

0 comments on commit 4ecdc21

Please sign in to comment.