Skip to content

Commit

Permalink
added simple test for issue #19
Browse files Browse the repository at this point in the history
  • Loading branch information
wikier committed Jan 12, 2014
1 parent e08356d commit 495b0e0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/wrapper_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ def testSetQuery(self):
self.wrapper.setQuery('UNKNOWN {e:a e:b e:c}')
self.assertEqual(SELECT, self.wrapper.queryType, 'unknown queries result in SELECT')

def testSetTimeout(self):
self.wrapper.setTimeout(10)
self.assertEqual(10, self.wrapper.timeout)

self.wrapper.resetQuery()
self.assertEqual(None, self.wrapper.timeout)

def testClearParameter(self):
self.wrapper.addParameter('param1', 'value1')
self.wrapper.addParameter('param1', 'value2')
Expand Down

1 comment on commit 495b0e0

@indeyets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wikier checking of private field doesn't do much help (it does harm, actually, as we can not change implementation details without breaking tests).

test has to test, that this value is actually used during socket initialization (mock of socket object is needed)

Please sign in to comment.