Fixing tests
Tests read the default hmac_secret from default_settings.json, and that value is read as a unicode object by the json parser, not str.
This commit is contained in:
parent
8e40315258
commit
ec65950a9b
@ -173,16 +173,6 @@ def GetCompletions_CsCompleter_DoesntStartWithAmbiguousMultipleSolutions_test():
|
|||||||
# the test passes if we caught an exception when trying to start it,
|
# the test passes if we caught an exception when trying to start it,
|
||||||
# so raise one if it managed to start
|
# so raise one if it managed to start
|
||||||
if not exception_caught:
|
if not exception_caught:
|
||||||
# Now for some cleanup: wait for the server to start then shut it down
|
|
||||||
while True:
|
|
||||||
result = app.post_json( '/run_completer_command',
|
|
||||||
BuildRequest( completer_target = 'filetype_default',
|
|
||||||
command_arguments = ['ServerRunning'],
|
|
||||||
filetype = 'cs' ) ).json
|
|
||||||
if result:
|
|
||||||
break
|
|
||||||
time.sleep( 0.2 )
|
|
||||||
|
|
||||||
StopOmniSharpServer( app )
|
StopOmniSharpServer( app )
|
||||||
raise Exception( ('The Omnisharp server started, despite us not being able '
|
raise Exception( ('The Omnisharp server started, despite us not being able '
|
||||||
'to find a suitable solution file to feed it. Did you '
|
'to find a suitable solution file to feed it. Did you '
|
||||||
|
@ -219,7 +219,8 @@ def ContentHexHmacValid( content, hmac, hmac_secret ):
|
|||||||
|
|
||||||
|
|
||||||
def CreateHexHmac( content, hmac_secret ):
|
def CreateHexHmac( content, hmac_secret ):
|
||||||
return hmac.new( hmac_secret,
|
# Must ensure that hmac_secret is str and not unicode
|
||||||
|
return hmac.new( str( hmac_secret ),
|
||||||
msg = content,
|
msg = content,
|
||||||
digestmod = hashlib.sha256 ).hexdigest()
|
digestmod = hashlib.sha256 ).hexdigest()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user