Skip to content

Commit

Permalink
test: check the test SCARDDWORDARG is an integer
Browse files Browse the repository at this point in the history
Test the code that checks SCARDDWORDARG is of the expected type
(integer).
  • Loading branch information
LudovicRousseau committed Mar 12, 2024
1 parent 2d51afc commit 008f543
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_Exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,13 @@ def test_BaseSCardException(self):
expected = "foo: " + expected + " (0x80100016)"
self.assertEqual(text, expected)

def test_wrongType(self):
# SCardEstablishContext() argument should be int or long
with self.assertRaises(TypeError):
hresult, hcontext = SCardEstablishContext([0])

with self.assertRaises(TypeError):
hresult, hcontext = SCardEstablishContext("foo")

if __name__ == '__main__':
unittest.main()

0 comments on commit 008f543

Please sign in to comment.