Exemple #1
0
 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]}
Exemple #2
0
 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]
     }
Exemple #3
0
 def test_serialize_behavior(self):
     assert Sdk.to_python({
         'name': 'sentry-unity',
         'version': '1.0',
     }).to_json() == {
         'name': 'sentry-unity',
         'version': '1.0',
     }
Exemple #4
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']
     }
Exemple #5
0
 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',
         }],
     }
Exemple #6
0
 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',
         }],
     }
Exemple #7
0
 def test_missing_version(self):
     assert Sdk.to_python({
         'name': 'sentry-unity',
     }).to_json() == {
         'name': 'sentry-unity',
     }
Exemple #8
0
 def test_missing_name(self):
     assert Sdk.to_python({
         'version': '1.0',
     }).to_json() == {
         'version': '1.0',
     }
Exemple #9
0
 def test_missing_version(self):
     assert Sdk.to_python({
         'name': 'sentry-unity',
     }).to_json() == {
         'name': 'sentry-unity',
     }
Exemple #10
0
 def test_missing_name(self):
     assert Sdk.to_python({
         'version': '1.0',
     }).to_json() == {
         'version': '1.0',
     }
Exemple #11
0
 def test_missing_version(self):
     with pytest.raises(InterfaceValidationError):
         assert Sdk.to_python({
             'name': 'sentry-unity',
         })
Exemple #12
0
 def test_missing_name(self):
     with pytest.raises(InterfaceValidationError):
         assert Sdk.to_python({
             'version': '1.0',
         })