Beispiel #1
0
    def test_save_replace_metadata(self):
        self.obj.baz = 'updated'
        self.obj.other = 'newval'
        self.obj.metadata = {
            'size': 'm',
            'info': 'a2',
            'score': 4,
        }

        self.checkSave()

        self.requestor_mock.request.assert_called_with(
            'put', '/v1/{0}/myupdateables/myid'.format(openpay.merchant_id),
            MyUpdateable.construct_from(
                {
                    'baz': 'updated',
                    'other': 'newval',
                    'id': 'myid',
                    'foo': 'bar',
                    'status': None,
                    'metadata': {
                        'size': 'm',
                        'info': 'a2',
                        'height': '',
                        'score': 4,
                    }
                }, 'mykey'))
    def test_save_replace_metadata(self):
        self.obj.baz = 'updated'
        self.obj.other = 'newval'
        self.obj.metadata = {
            'size': 'm',
            'info': 'a2',
            'score': 4,
        }

        self.checkSave()

        self.requestor_mock.request.assert_called_with(
            'put',
            '/v1/{0}/myupdateables/myid'.format(openpay.merchant_id),
            MyUpdateable.construct_from({
                'baz': 'updated',
                'other': 'newval',
                'id': 'myid',
                'foo': 'bar',
                'status': None,
                'metadata': {
                    'size': 'm',
                    'info': 'a2',
                    'height': '',
                    'score': 4,
                }
            }, 'mykey')
        )
Beispiel #3
0
    def setUp(self):
        super(UpdateableAPIResourceTests, self).setUp()

        self.mock_response({'thats': 'it'})

        self.obj = MyUpdateable.construct_from(
            {
                'id': 'myid',
                'foo': 'bar',
                'baz': 'boz',
                'metadata': {
                    'size': 'l',
                    'score': 4,
                    'height': 10
                }
            }, 'mykey')
    def setUp(self):
        super(UpdateableAPIResourceTests, self).setUp()

        self.mock_response({
            'thats': 'it'
        })

        self.obj = MyUpdateable.construct_from({
            'id': 'myid',
            'foo': 'bar',
            'baz': 'boz',
            'metadata': {
                'size': 'l',
                'score': 4,
                'height': 10
            }
        }, 'mykey')