def test_update(self): fake_data = Table([{'id': '1234567890AaBbC', 'firstname': 'Chrisjen', 'lastname': 'Avasarala'}]) response = self.sf.update_record('Contact', fake_data) assert self.sf.client.bulk.Contact.update.called_with(fake_data) assert not response[0]['created']
def test_upsert(self): fake_data = Table([{'id': '1234567890AaBbC', 'firstname': 'Chrisjen', 'lastname': 'Avasarala'}, {'id': None, 'firstname': 'Roberta', 'lastname': 'Draper'}]) response = self.sf.upsert_record('Contact', fake_data, 'id') assert self.sf.client.bulk.Contact.update.called_with(fake_data) print(response) assert not response[0]['created'] assert response[1]['created']
def test_delete(self): fake_data = Table([{'id': '1234567890AaBbC'}]) response = self.sf.delete_record('Contact', fake_data) assert self.sf.client.bulk.Contact.update.called_with(fake_data) assert not response[0]['created']
def test_insert(self): fake_data = Table([{'firstname': 'Chrisjen', 'lastname': 'Avasarala'}]) response = self.sf.insert_record('Contact', fake_data) assert self.sf.client.bulk.Contact.insert.called_with(fake_data) assert response[0]['created']