You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The _add_autosized_batches function creates no batch when only one record is passed as data.
The test below creates a single object, passes it to the function and checks that only one batch was created.
However none are created so the test fails
@mock.patch('simple_salesforce.bulk.SFBulkType._add_batch')
def test_add_autosized_batches_single_record(self, add_batch):
"""Test that _add_autosized_batches a single record correctly"""
add_batch.side_effect = lambda job_id, data, operation: data
sf_bulk_type = SFBulkType(None, None, None, None)
data = [{'key': 'value'}]
result = sf_bulk_type._add_autosized_batches( # pylint: disable=protected-access
data=data, operation="update", job="Job-1"
)
self.assertEqual(len(result), 1)
The text was updated successfully, but these errors were encountered:
The
_add_autosized_batches
function creates no batch when only one record is passed as data.The test below creates a single object, passes it to the function and checks that only one batch was created.
However none are created so the test fails
The text was updated successfully, but these errors were encountered: