Skip to content

Commit 1f3316e

Browse files
author
Ted S
authored
Merge pull request #21 from laslabs/bugfix/0.1/fix-sequence
[FIX] carepoint: Fix sequence generation
2 parents d70b452 + 7d8164c commit 1f3316e

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

carepoint/db/carepoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def get_next_sequence(self, sequence_name, db_name='cph'):
326326
Integer to use as pk
327327
"""
328328
with self._get_session(db_name) as session:
329-
res = session.execute(
329+
res = session.connection().execute(
330330
text(
331331
"SET NOCOUNT ON;"
332332
"DECLARE @out int = 0;"

carepoint/tests/db/test_carepoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,15 @@ def test_get_next_sequence_execute(self, text):
293293
expect = 'expect'
294294
with mock.patch.object(self.carepoint, '_get_session') as mk:
295295
self.carepoint.get_next_sequence(expect)
296-
mk().__enter__().execute.assert_called_once_with(
296+
mk().__enter__().connection().execute.assert_called_once_with(
297297
text(), seq_name=expect,
298298
)
299299

300300
def test_get_next_sequence_fetch(self):
301301
""" It should return result of fetch """
302302
with mock.patch.object(self.carepoint, '_get_session') as mk:
303303
res = self.carepoint.get_next_sequence(None)
304-
expect = mk().__enter__().execute().fetchall()[0][0]
304+
expect = mk().__enter__().connection().execute().fetchall()[0][0]
305305
self.assertEqual(
306306
expect, res,
307307
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup_vals = {
1111
'name': 'carepoint',
12-
'version': '0.1.5',
12+
'version': '0.1.6',
1313
'author': 'LasLabs Inc.',
1414
'author_email': 'support@laslabs.com',
1515
'description': 'This library will allow you to interact with CarePoint '

0 commit comments

Comments
 (0)