def test_null_values(self): sink = {} assert Sdk.to_python({}).to_json() == sink assert Sdk.to_python({'name': None}).to_json() == sink assert Sdk.to_python({'integrations': []}).to_json() == sink assert Sdk.to_python({'packages': None}).to_json() == sink assert Sdk.to_python({'packages': [None]}).to_json() == {"packages": [None]}
def test_null_values(self): sink = {} assert Sdk.to_python({}).to_json() == sink assert Sdk.to_python({'name': None}).to_json() == sink assert Sdk.to_python({'integrations': []}).to_json() == sink assert Sdk.to_python({'packages': None}).to_json() == sink assert Sdk.to_python({ 'packages': [None] }).to_json() == { "packages": [None] }
def test_serialize_behavior(self): assert Sdk.to_python({ 'name': 'sentry-unity', 'version': '1.0', }).to_json() == { 'name': 'sentry-unity', 'version': '1.0', }
def test_serialize_behavior(self): assert Sdk.to_python({ 'name': 'sentry-java', 'version': '1.0', 'integrations': ['log4j'] }).to_json() == { 'name': 'sentry-java', 'version': '1.0', 'integrations': ['log4j'] }
def test_serialize_behavior(self): assert Sdk.to_python({ 'name': 'sentry-java', 'version': '1.0', 'integrations': ['log4j'], 'packages': [{ 'name': 'maven:io.sentry.sentry', 'version': '1.7.10', }], }).to_json() == { 'name': 'sentry-java', 'version': '1.0', 'integrations': ['log4j'], 'packages': [{ 'name': 'maven:io.sentry.sentry', 'version': '1.7.10', }], }
def test_missing_version(self): assert Sdk.to_python({ 'name': 'sentry-unity', }).to_json() == { 'name': 'sentry-unity', }
def test_missing_name(self): assert Sdk.to_python({ 'version': '1.0', }).to_json() == { 'version': '1.0', }
def test_missing_version(self): with pytest.raises(InterfaceValidationError): assert Sdk.to_python({ 'name': 'sentry-unity', })
def test_missing_name(self): with pytest.raises(InterfaceValidationError): assert Sdk.to_python({ 'version': '1.0', })