예제 #1
0
def main():
    params = {
        "server": "mpilgrim",
        "database": "master",
        "uid": "sa",
        "pwd": "secret"
    }
    print odbchelper.buildConnectionString(params)
    print odbchelper.buildConnectionString.__doc__
예제 #2
0
	def testKnownValue(self):
		"""buildConnectionString returns known result with known input"""
		params = {"server":"mpilgrim", "database":"master", "uid":"sa", "pwd":"secret"}
		knownItems = params.items()
		knownItems.sort()
		knownString = repr(knownItems)
		result = odbchelper.buildConnectionString(params)
		resultItems = [tuple(e.split("=")) for e in result.split(";")]
		resultItems.sort()
		resultString = repr(resultItems)
		self.assertEqual(knownString, resultString)
예제 #3
0
 def testKnownValue(self):
     """buildConnectionString returns known result with known input"""
     params = {
         "server": "mpilgrim",
         "database": "master",
         "uid": "sa",
         "pwd": "secret"
     }
     knownItems = params.items()
     knownItems.sort()
     knownString = repr(knownItems)
     result = odbchelper.buildConnectionString(params)
     resultItems = [tuple(e.split("=")) for e in result.split(";")]
     resultItems.sort()
     resultString = repr(resultItems)
     self.assertEqual(knownString, resultString)
예제 #4
0
	def testBlank(self):
		"""buildConnectionString handles empty dictionary"""
		self.assertEqual("", odbchelper.buildConnectionString({}))
예제 #5
0
 def testBlank(self):
     """buildConnectionString handles empty dictionary"""
     self.assertEqual("", odbchelper.buildConnectionString({}))
예제 #6
0
import odbchelper
params = {
    "server": "mpilgrim",
    "database": "master",
    "uid": "sa",
    "pwd": "secret"
}
print odbchelper.buildConnectionString(params)

print odbchelper.buildConnectionString.__doc__

# Traceback (most recent call last):
#   File "ex2.py", line 1, in <module>
#     import odbchelper
# ImportError: No module named odbchelper
예제 #7
0
def main():
    params={"server":"mpilgrim", "database":"master", "uid":"sa", "pwd":"secret"}
    print odbchelper.buildConnectionString(params)
    print odbchelper.buildConnectionString.__doc__
예제 #8
0
파일: lab02.py 프로젝트: agzon/py-dive
def call_buildConnectionString():
    params = {"server":"mpilgrim", "database":"master", "uid":"sa", "pwd":"secret"}
    return odbchelper.buildConnectionString(params)
예제 #9
0
import odbchelper


if __name__ == "__main__":
    params = {"server":"mpilgrim", "database":"master", "uid":"sa", "pwd":"secret"}
    print odbchelper.buildConnectionString(params)
    print odbchelper.buildConnectionString.__doc__