def get_metadata(self, data): from sentry.interfaces.security import ExpectStaple expectstaple = ExpectStaple.to_python(data['expectstaple']) return { 'origin': expectstaple.get_origin(), 'message': expectstaple.get_message(), }
def get_metadata(self): from sentry.interfaces.security import ExpectStaple expectstaple = ExpectStaple.to_python(self.data['expectstaple']) return { 'origin': expectstaple.get_origin(), 'message': expectstaple.get_message(), }
def get_metadata(self, data): from sentry.interfaces.security import ExpectStaple expectstaple = ExpectStaple.to_python(data["expectstaple"]) return { "origin": expectstaple.get_origin(), "message": expectstaple.get_message() }
def test_serialize_unserialize_behavior(self): assert ExpectStaple.to_python( self.interface_json).to_json() == self.interface_json
def test_to_python(self): interface = ExpectStaple.to_python(self.interface_json) assert interface.hostname == 'www.example.com' assert interface.date_time == '2014-04-06T13:00:50Z' assert interface.port == 443 assert len(interface.served_certificate_chain) == 1
def test_serialize_unserialize_behavior(self): assert ExpectStaple.to_python(self.interface_json).to_json() == self.interface_json