Skip to content

Add unit tests for app.py #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

cbonoz
Copy link

@cbonoz cbonoz commented Oct 25, 2017

No description provided.

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Oct 25, 2017
@SendGridDX
Copy link

SendGridDX commented Oct 25, 2017

CLA assistant check
All committers have signed the CLA.

@cbonoz cbonoz mentioned this pull request Oct 25, 2017
@codecov-io
Copy link

Codecov Report

Merging #441 into master will increase coverage by 0.43%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #441      +/-   ##
==========================================
+ Coverage   82.38%   82.81%   +0.43%     
==========================================
  Files           9        9              
  Lines         999     1001       +2     
  Branches      160      160              
==========================================
+ Hits          823      829       +6     
+ Misses         86       82       -4     
  Partials       90       90
Impacted Files Coverage Δ
sendgrid/helpers/inbound/app.py 92% <33.33%> (+18.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c422e2...e531190. Read the comment docs.

Copy link
Contributor

@mbernier mbernier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests ran and passed locally for me.

@mbernier mbernier added difficulty: medium fix is medium in difficulty hacktoberfest labels Oct 27, 2017
@@ -0,0 +1,35 @@
from unittest import mock
from unittest.mock import MagicMock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Python 2.6, 2.7 builds to pass, we have to add a little bit of trickery:

try:
    import unittest2 as unittest
except ImportError:
    import unittest

and for mock, it looks like we can borrow some advice from this guy:

try:
    from mock import patch, mock_open
except ImportError:
    from unittest.mock import patch, mock_open

Can you please make these two changes? I am hoping the build will pass once this is done!

@mbernier
Copy link
Contributor

@cbonoz I am checking in to see if you can please make the suggested change?

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Oct 29, 2017
@cbuonocore-toasttab
Copy link

cbuonocore-toasttab commented Nov 2, 2017

Go ahead and close this. Saw that other tests had been merged.

@thinkingserious
Copy link
Contributor

@cbonoz

We have not been able to merge your Pull Request, but because you are awesome - we wanted to make sure you could still get a SendGrid Hacktoberfest shirt.

Please go fill out our swag form before Nov 5th and we will send the shirt! (We know that you might have tried this before and it didn’t work, sorry about that!)

You have till Nov 5th to fill out this form in order to get the Hacktoberfest shirt!

Thank you for contributing during Hacktoberfest! We hope to see you in the repos soon! Just so you know, we always give away a SendGrid shirt for your first ever non-Hacktoberfest PR that gets merged.

@cbonoz
Copy link
Author

cbonoz commented Nov 2, 2017

@thinkingserious 👍 Always appreciate the swag. Thanks.

@cbonoz cbonoz closed this Nov 2, 2017
@cbonoz cbonoz deleted the sendgrid-app-tests branch November 2, 2017 17:08
@thinkingserious
Copy link
Contributor

Hi @cbonoz,

Why did you close this PR?

With Best Regards,

Elmer

@cbonoz
Copy link
Author

cbonoz commented Nov 4, 2017

Coverage was added by #433

@thinkingserious
Copy link
Contributor

Cool, thanks for the update :)

@mbernier
Copy link
Contributor

If you are interested, we would love the opportunity to talk to you about Hacktoberfest and our API libraries.

Our agenda would be: Explore what you liked and is there anything we can do to improve?

You can grab a time on my calendar that works for you and we can have a chat on Google Hangout or Skype. If you prefer, you can email me using my GitHub username at my company’s domain.

Thank you so much,

Matt Bernier - @mbernier - SendGrid Developer Experience Product Manager
Elmer Thomas - @thinkingserious - SendGrid Developer Experience Engineer
@sendgrid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants