Skip to content

Instantly share code, notes, and snippets.

@ywkaras
Created July 5, 2018 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ywkaras/e9419612ba7879750673b9f5bab5993f to your computer and use it in GitHub Desktop.
Save ywkaras/e9419612ba7879750673b9f5bab5993f to your computer and use it in GitHub Desktop.
Python format error
body = ('''
{
"beacons": [
{
"url" : "http://127.0.0.1:{0}",
"action": "return_204"
}
],
"version": "0.1"
}
'''
).format(666)
Error:
Running Test beacon_intercept:
Generating Report: --------------
Test: beacon_intercept: Exception
File: beacon_intercept.test.py
Directory: /Users/wkaras/REPOS/YTS/tests/gold_tests/pluginTest/beacon_intercept
Reason: Traceback (most recent call last):
File "/Users/wkaras/REPOS/YTS/tests/env-test/lib/python3.5/site-packages/autest/core/runtesttask.py", line 34, in __call__
tl = self.__logic.Run(self.__test)
File "/Users/wkaras/REPOS/YTS/tests/env-test/lib/python3.5/site-packages/autest/runlogic/runlogic.py", line 18, in Run
if not tmp.Start(obj):
File "/Users/wkaras/REPOS/YTS/tests/env-test/lib/python3.5/site-packages/autest/runlogic/test.py", line 89, in Start
loadTest(self.__test)
File "/Users/wkaras/REPOS/YTS/tests/env-test/lib/python3.5/site-packages/autest/core/test.py", line 179, in loadTest
execFile(fileName, locals, locals)
File "/Users/wkaras/REPOS/YTS/tests/env-test/lib/python3.5/site-packages/autest/common/execfile.py", line 15, in execFile
exec (safeCompile(f.read(), fname), globals, locals)
File "/Users/wkaras/REPOS/YTS/tests/gold_tests/pluginTest/beacon_intercept/beacon_intercept.test.py", line 50, in <module>
).format(666)
KeyError: '\n "beacons"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment