Stylistic pre-commit junk
parent
99bf4215a3
commit
00b78e7a47
|
@ -537,8 +537,10 @@ _JSON_ESCAPE_MAP = {
|
|||
"f": "\f",
|
||||
"n": "\n",
|
||||
"r": "\r",
|
||||
"t": "\t"
|
||||
"t": "\t",
|
||||
}
|
||||
|
||||
|
||||
def _un_json_escape(json_string):
|
||||
"""
|
||||
Removes JSON string literal escapes. We should undo these things Python's
|
||||
|
|
|
@ -189,14 +189,16 @@ def test_empty_hash():
|
|||
SomeSCO(hashes={})
|
||||
|
||||
|
||||
@pytest.mark.parametrize("json_escaped, expected_unescaped", [
|
||||
("", ""),
|
||||
("a", "a"),
|
||||
(r"\n", "\n"),
|
||||
(r"\n\r\b\t\\\/\"", "\n\r\b\t\\/\""),
|
||||
(r"\\n", r"\n"),
|
||||
(r"\\\n", "\\\n")
|
||||
])
|
||||
@pytest.mark.parametrize(
|
||||
"json_escaped, expected_unescaped", [
|
||||
("", ""),
|
||||
("a", "a"),
|
||||
(r"\n", "\n"),
|
||||
(r"\n\r\b\t\\\/\"", "\n\r\b\t\\/\""),
|
||||
(r"\\n", r"\n"),
|
||||
(r"\\\n", "\\\n"),
|
||||
],
|
||||
)
|
||||
def test_json_unescaping(json_escaped, expected_unescaped):
|
||||
actual_unescaped = stix2.base._un_json_escape(json_escaped)
|
||||
assert actual_unescaped == expected_unescaped
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import datetime as dt
|
||||
import re
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
import pytz
|
||||
|
|
Loading…
Reference in New Issue