def test_full_errno_meta(self): data = { 'type': 'generic', 'meta': { 'errno': { 'number': 2, 'name': 'ENOENT', } } } assert Mechanism.to_python(data).to_json() == data
def test_min_signal_meta(self): data = { 'type': 'generic', 'meta': { 'signal': { 'number': 10, 'code': 0, } } } assert Mechanism.to_python(data).to_json() == data
def test_min_mach_meta(self): data = { 'type': 'generic', 'meta': { 'mach_exception': { 'exception': 10, 'code': 0, 'subcode': 0, } } } assert Mechanism.to_python(data).to_json() == data
def test_full_signal_meta(self): data = { 'type': 'generic', 'meta': { 'signal': { 'number': 10, 'code': 0, 'name': 'SIGBUS', 'code_name': 'BUS_NOOP', } } } assert Mechanism.to_python(data).to_json() == data
def test_tag(self): data = {'type': 'generic'} inst = Mechanism.to_python(data) assert list(inst.iter_tags()) == [('mechanism', 'generic')]
def test_empty_mechanism(self): data = {'type': 'generic'} assert Mechanism.to_python(data).to_json() == data
def test_path(self): inst = Mechanism.to_python({'type': 'generic'}) assert inst.get_path() == 'mechanism'
def test_data(self): data = { 'type': 'generic', 'data': {'relevant_address': '0x1'}, } assert Mechanism.to_python(data).to_json() == data