mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-23 21:21:27 -05:00
python3 compatibility + webapp to flask refactoring
This commit is contained in:
+61
@@ -0,0 +1,61 @@
|
||||
import libraries.stripe
|
||||
from libraries.stripe.test.helper import StripeResourceTest
|
||||
|
||||
|
||||
class MetadataTest(StripeResourceTest):
|
||||
|
||||
def test_noop_metadata(self):
|
||||
charge = libraries.stripe.Charge(id='ch_foo')
|
||||
charge.description = 'test'
|
||||
charge.save()
|
||||
|
||||
self.requestor_mock.request.assert_called_with(
|
||||
'post',
|
||||
'/v1/charges/ch_foo',
|
||||
{
|
||||
'description': 'test',
|
||||
},
|
||||
None
|
||||
)
|
||||
|
||||
def test_unset_metadata(self):
|
||||
charge = libraries.stripe.Charge(id='ch_foo')
|
||||
charge.metadata = {}
|
||||
charge.save()
|
||||
|
||||
self.requestor_mock.request.assert_called_with(
|
||||
'post',
|
||||
'/v1/charges/ch_foo',
|
||||
{
|
||||
'metadata': {},
|
||||
},
|
||||
None
|
||||
)
|
||||
|
||||
def test_whole_update(self):
|
||||
charge = libraries.stripe.Charge(id='ch_foo')
|
||||
charge.metadata = {'whole': 'update'}
|
||||
charge.save()
|
||||
|
||||
self.requestor_mock.request.assert_called_with(
|
||||
'post',
|
||||
'/v1/charges/ch_foo',
|
||||
{
|
||||
'metadata': {'whole': 'update'},
|
||||
},
|
||||
None
|
||||
)
|
||||
|
||||
def test_individual_delete(self):
|
||||
charge = libraries.stripe.Charge(id='ch_foo')
|
||||
charge.metadata = {'whole': None}
|
||||
charge.save()
|
||||
|
||||
self.requestor_mock.request.assert_called_with(
|
||||
'post',
|
||||
'/v1/charges/ch_foo',
|
||||
{
|
||||
'metadata': {'whole': None},
|
||||
},
|
||||
None
|
||||
)
|
||||
Reference in New Issue
Block a user