def test_not_null(self, test_input): with pytest.raises(ValueError): parse_value(test_input, "null")
def test_emptystring(self): assert parse_value("", "string") == ""
def test_null(self): assert parse_value("null", "null") is None
def test_number(self): assert parse_value("123", "string") == "123"
def test_boolean(self): assert parse_value("true", "string") == "true"
def test_false(self): assert parse_value("false", "boolean") is False
def test_not_boolean(self, test_input): with pytest.raises(ValueError): parse_value(test_input, "boolean")
def test_true(self): assert parse_value("true", "boolean") is True
def test_exception(self, test_input): with pytest.raises(ValueError): parse_value(test_input, "number")
def test_int(self): assert parse_value("120", "number") == 120
def test_float(self, test_input, expected): assert parse_value(test_input, "number") == expected
def test_int(self): assert parse_value("2", "integer") == 2