-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add integration tests #240
Conversation
a9249fe
to
a1d91a5
Compare
Can you fix the lint? |
Try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far!
Since this is such a large PR I'll try to get the rest of my review out tomorrow 👍
NOTE: I think there needs to be an empty __init__.py
file in test/integration
to get imports working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the second half 🙂
…integration-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I found these two issues when running the test suite, but otherwise things are passing 🎉
assert re.search("[a-zA-Z]+", account.first_name) | ||
assert re.search("[a-zA-Z]+", account.last_name) | ||
assert re.search( | ||
"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", account.email | ||
) | ||
assert re.search( | ||
"^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$", account.phone | ||
) | ||
assert re.search("[a-zA-Z0-9]+", account.address_1) | ||
assert re.search("[a-zA-Z0-9]+", account.address_2) | ||
assert re.search("[a-zA-Z]+", account.city) | ||
assert re.search("[a-zA-Z]+", account.state) | ||
assert re.search("[a-zA-Z]+", account.country) | ||
assert re.search("[a-zA-Z0-9]+", account.zip) | ||
if account.tax_id: | ||
assert re.search("[0-9]+", account.tax_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be aware that some account may have these attribute as empty strings...
And we also have test_get_account
in test/integration/models/test_account.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but we are using two different ways to get account details.
E.g.
account = client.account()
account = client.load(Account, account_id)
I updated the regex so it can check empty string as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests are passing, nice work!
📝 Description
Adding integration tests - more details at:https://jira.linode.com/browse/TPT-1831
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
How do I run the relevant unit/integration tests?
📷 Preview
If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.