writing up test cases (executable documentation)

legacy
Steve L. Nyemba 5 years ago
parent 968bda4c0a
commit 3e30fd73f7

@ -0,0 +1,30 @@
from api.store import Store
import unittest
import json
import stripe
class TestStore(unittest.TestCase):
def setUp(self):
stripe.api_key = 'sk_test_I16uOM1ZfGALSc03AF0xqN2z'
def test_getPlans(self):
mystore = Store(product='music')
self.assertTrue(mystore.get.plans())
pass
def test_getUser(self):
"""
"""
email='nyemba@gmail.com'
mystore = Store(product='music')
self.assertTrue(mystore.get.user(email='nyemba@gmail.com'))
def test_UserPlan(self):
"""
For a given product we would like to know what our user's plan is
"""
email = 'nyemba@gmail.com'
mystore = Store(product='music')
print(mystore.get.plans(email=email))['id']
pass
if __name__ == '__main__':
unittest.main()
Loading…
Cancel
Save