Skip to content

Commit 15eb73b

Browse files
committed
Added connection properties test
1 parent 2a8f6ed commit 15eb73b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/nuodb_basic_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import unittest
1111
import decimal
12+
import platform
1213
import time
1314
import os
1415
import sys
@@ -457,6 +458,22 @@ def test_long_string_types(self):
457458
finally:
458459
con.close()
459460

461+
def test_connection_properties(self):
462+
463+
clientInfo = "NuoDB Python driver"
464+
tmp_args = self.connect_kw_args.copy()
465+
tmp_args['options'] = {'schema': 'test', 'clientInfo': clientInfo}
466+
con = pynuodb.connect(**tmp_args)#self._connect({'clientInfo':'Hello World'})
467+
cursor = con.cursor()
468+
cursor.execute("select * from SYSTEM.CONNECTIONS")
469+
result = cursor.fetchone()
470+
471+
#Make sure our clientHost, clientProcessId and clientInfo remain the same in the SYSTEM.CONNECTIONS table
472+
self.assertEqual(platform.node(), result[17])
473+
self.assertEqual(str(os.getpid()), result[18])
474+
self.assertEqual(clientInfo, result[19])
475+
476+
460477
def test_utf8_string_types(self):
461478
con = self._connect()
462479
cursor = con.cursor()

0 commit comments

Comments
 (0)