Skip to content

Commit

Permalink
fix(apiclient): fix useragent string. missing semicolon
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Mar 29, 2019
1 parent 9c706e9 commit 8161b41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hexonet/apiconnector/apiclient.py
Expand Up @@ -84,7 +84,7 @@ def getUserAgent(self):
pyv = platform.python_version()
pf = platform.system()
arch = platform.architecture()[0]
self.__ua = "%s (%s %s rv:%s) python/%s" % (pid, pf, arch, self.getVersion(), pyv)
self.__ua = "%s (%s; %s; rv:%s) python/%s" % (pid, pf, arch, self.getVersion(), pyv)
return self.__ua

def setUserAgent(self, pid, rv):
Expand All @@ -94,7 +94,7 @@ def setUserAgent(self, pid, rv):
pyv = platform.python_version()
pf = platform.system()
arch = platform.architecture()[0]
self.__ua = "%s (%s %s rv:%s) python-sdk/%s python/%s" % (pid, pf, arch, rv, self.getVersion(), pyv)
self.__ua = "%s (%s; %s; rv:%s) python-sdk/%s python/%s" % (pid, pf, arch, rv, self.getVersion(), pyv)

def getVersion(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_apiclient.py
Expand Up @@ -111,7 +111,7 @@ def test_apiclientmethods():
pyv = platform.python_version()
pf = platform.system()
arch = platform.architecture()[0]
ua = "%s (%s %s rv:%s) python/%s" % (pid, pf, arch, cl.getVersion(), pyv)
ua = "%s (%s; %s; rv:%s) python/%s" % (pid, pf, arch, cl.getVersion(), pyv)
assert cl.getUserAgent() == ua

# #.setUserAgent()
Expand All @@ -121,7 +121,7 @@ def test_apiclientmethods():
pyv = platform.python_version()
pf = platform.system()
arch = platform.architecture()[0]
ua = "%s (%s %s rv:%s) %s/%s python/%s" % (pid, pf, arch, rv, pid2, cl.getVersion(), pyv)
ua = "%s (%s; %s; rv:%s) %s/%s python/%s" % (pid, pf, arch, rv, pid2, cl.getVersion(), pyv)
cl.setUserAgent(pid, rv)
assert cl.getUserAgent() == ua

Expand Down

0 comments on commit 8161b41

Please sign in to comment.