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:
Strahinja Val Markovic 2014-05-09 10:22:00 -07:00
parent 8e40315258
commit ec65950a9b
2 changed files with 2 additions and 11 deletions

View File

@ -173,16 +173,6 @@ def GetCompletions_CsCompleter_DoesntStartWithAmbiguousMultipleSolutions_test():
# the test passes if we caught an exception when trying to start it,
# so raise one if it managed to start
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 )
raise Exception( ('The Omnisharp server started, despite us not being able '
'to find a suitable solution file to feed it. Did you '

View File

@ -219,7 +219,8 @@ def ContentHexHmacValid( content, hmac, 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,
digestmod = hashlib.sha256 ).hexdigest()