[Pcsclite-cvs-commit] r4793 - in /trunk/PCSC/UnitaryTests: SCardBlockingBehaviourTest.py SCardExclusiveBehaviour.py
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Thu Mar 4 13:58:59 UTC 2010
Author: rousseau
Date: Thu Mar 4 13:58:59 2010
New Revision: 4793
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4793
Log:
make pylint happier
Modified:
trunk/PCSC/UnitaryTests/SCardBlockingBehaviourTest.py
trunk/PCSC/UnitaryTests/SCardExclusiveBehaviour.py
Modified: trunk/PCSC/UnitaryTests/SCardBlockingBehaviourTest.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/SCardBlockingBehaviourTest.py?rev=4793&op=diff
==============================================================================
--- trunk/PCSC/UnitaryTests/SCardBlockingBehaviourTest.py (original)
+++ trunk/PCSC/UnitaryTests/SCardBlockingBehaviourTest.py Thu Mar 4 13:58:59 2010
@@ -1,8 +1,10 @@
#!/usr/bin/env python
+"""
# Copyright (c) 2010 Jean-Luc Giraud (jlgiraud at mac.com)
# All rights reserved.
-#
+"""
+
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@@ -42,6 +44,7 @@
def check(testFunctionName, hresult, duration):
+ """ check """
if hresult != SCARD_S_SUCCESS:
print "%s failed: %s" % (testFunctionName, SCardGetErrorMessage(hresult))
print 'Failure for "Sharing violation" are OK for non blocking calls'
@@ -49,6 +52,7 @@
def SCardReconnectTest(hcontextTest, hcardTest, readerName):
+ """ SCardReconnectTest """
global unblocked
testFunctionName = sys._getframe().f_code.co_name
print "Test thread for %s" % testFunctionName
@@ -59,6 +63,7 @@
def SCardGetAttribTest(hcontextTest, hcardTest, readerName):
+ """ SCardGetAttribTest """
global unblocked
testFunctionName = sys._getframe().f_code.co_name
print "Test thread for %s" % testFunctionName
@@ -69,6 +74,7 @@
def SCardTransmitTest(hcontextTest, hcardTest, readerName):
+ """ SCardTransmitTest """
global unblocked
testFunctionName = sys._getframe().f_code.co_name
print "Test thread for %s" % testFunctionName
@@ -81,6 +87,7 @@
def SCardStatusTest(hcontextTest, hcardTest, readerName):
+ """ SCardStatusTest """
global unblocked
testFunctionName = sys._getframe().f_code.co_name
print "Test thread for %s" % testFunctionName
@@ -91,6 +98,7 @@
def SCardConnectTest(hcontextTest, hcardTest, readerName):
+ """ SCardConnectTest """
global unblocked
testFunctionName = sys._getframe().f_code.co_name
print "Test thread for %s" % testFunctionName
@@ -107,6 +115,7 @@
def SCardBeginTransactionTest(hcontextTest, hcardTest, readerName):
+ """ SCardBeginTransactionTest """
global unblocked
testFunctionName = sys._getframe().f_code.co_name
print "Test thread for %s" % testFunctionName
@@ -120,14 +129,14 @@
unblocked = True
-def TemplateTest(hcontextTest, hcardTest, readerName):
- global unblocked
- testFunctionName = sys._getframe().f_code.co_name
- print "Test thread for %s" % testFunctionName
- before = time.time()
- hresult, attrib = Template(hcardTest, SCARD_ATTR_DEVICE_FRIENDLY_NAME_A)
- check(testFunctionName, hresult, time.time() - before)
- unblocked = True
+#def TemplateTest(hcontextTest, hcardTest, readerName):
+# global unblocked
+# testFunctionName = sys._getframe().f_code.co_name
+# print "Test thread for %s" % testFunctionName
+# before = time.time()
+# hresult, attrib = Template(hcardTest, SCARD_ATTR_DEVICE_FRIENDLY_NAME_A)
+# check(testFunctionName, hresult, time.time() - before)
+# unblocked = True
# Format:
Modified: trunk/PCSC/UnitaryTests/SCardExclusiveBehaviour.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/SCardExclusiveBehaviour.py?rev=4793&op=diff
==============================================================================
--- trunk/PCSC/UnitaryTests/SCardExclusiveBehaviour.py (original)
+++ trunk/PCSC/UnitaryTests/SCardExclusiveBehaviour.py Thu Mar 4 13:58:59 2010
@@ -3,9 +3,11 @@
# Check the return value of SCardConnect() on a reader already used in
# SCARD_SHARE_EXCLUSIVE mode
+"""
# Copyright (c) 2010 Jean-Luc Giraud (jlgiraud at mac.com)
# All rights reserved.
-#
+"""
+
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@@ -34,9 +36,11 @@
from smartcard.scard import *
+import sys
def Connect(mode):
+ """ Connect """
hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER)
if hresult != SCARD_S_SUCCESS:
raise Exception('Failed to establish context: ' + SCardGetErrorMessage(hresult))
@@ -55,6 +59,7 @@
def ConnectWithReader(readerName, mode):
+ """ ConnectWithReader """
hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER)
if hresult != SCARD_S_SUCCESS:
raise Exception('Failed to establish context: ' + SCardGetErrorMessage(hresult))
More information about the Pcsclite-cvs-commit
mailing list