def test_clean_old_defaults_INIT_OPTIONS(self): json_str = """minZoom: 0.5, maxZoom: 1.5, wheelSensitivity: 0.1, zoomingEnabled: false, userZoomingEnabled: false, autoungrabify: true, autounselectify: true, """ self.assertValidJSON(clean_JSON(json_str))
def test_clean_old_defaults_EDGE_STYLES(self): json_str = """'width': 1, 'curve-style': 'bezier', 'line-color': 'black', 'line-style': 'solid', 'target-arrow-shape': 'triangle-backcurve', 'target-arrow-color':'black', 'text-rotation': 'autorotate', 'label': 'data(label)', """ self.assertValidJSON(clean_JSON(json_str))
def test_clean_old_defaults_NODE_STYLES(self): json_str = """label: 'data(label)', 'text-valign': 'center', 'text-halign': 'right', 'text-margin-x': '-155', 'text-wrap': 'wrap', 'text-max-width': 150, 'width': 180, 'background-fit':'contain', 'shape': 'roundrectangle', 'background-opacity': 0, 'background-position-x': 0, 'height': 24, 'border-width': 1, 'padding-right': 5, 'padding-left':5, 'padding-top':5, 'padding-bottom':5, 'text-events': 'yes', 'font-size': 12, """ self.assertValidJSON(clean_JSON(json_str))
def test_clean_json_single_quoted_key(self): self.assertValidJSON(clean_JSON('\'key\': true'))
def test_clean_json_unquoted_key(self): self.assertValidJSON(clean_JSON('key: true'))
def test_clean_json_trailing_comma_with_braces(self): self.assertValidJSON(clean_JSON('{"key": true,}'))
def test_clean_json_trailing_comma_no_braces(self): self.assertValidJSON(clean_JSON('"key": true,'))
def test_clean_json_no_braces(self): self.assertValidJSON(clean_JSON('"key": true'))