def test_point_struct(self): ret = get_grammar().parseString(FIXTURE_POINT) expected = [ 'A', 'a', '=', ['B', 'a.b.c.d', '=', '24', 'C', 'e.f.g.h', '=', '42'] ] self.assertTrue(str(ret) == str(expected))
def test_grammar(self): expr = get_grammar() ret = expr.parseString(FIXTURE_RECURSIVE) expected = [ 'PIO_STATUS_BLOCK', 'IoStatusBlock', '=', [ 'PVOID', 'Pointer', '=', '0x00000103', 'ULONG', 'Status', '=', '12855664', 'ULONG', 'Information', '=', '12855664', 'PIO_STATUS_BLOCK', 'IoStatusBlock', '=', [ 'PVOID', 'Pointer', '=', '0x00000103', 'ULONG', 'Status', '=', '12855664', 'ULONG', 'Information', '=', '12855664', 'PIO_STATUS_BLOCK', 'IoStatusBlock', '=', [ 'PVOID', 'Pointer', '=', '0x00000103', 'ULONG', 'Status', '=', '12855664', 'ULONG', 'Information', '=', '12855664', 'PUNICODE_STRING', 'ObjectName', '=', '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Srp\\GP\\DLL' ] ] ] ] # Kinda lame but at least we have it self.assertTrue(str(ret) == str(expected))
def test_grammar(self): expr = get_grammar() ret = expr.parseString(FIXTURE_RECURSIVE) expected = ['PIO_STATUS_BLOCK', 'IoStatusBlock', '=', [ 'PVOID', 'Pointer', '=', '0x00000103', 'ULONG', 'Status', '=', '12855664', 'ULONG', 'Information', '=', '12855664', 'PIO_STATUS_BLOCK', 'IoStatusBlock', '=', [ 'PVOID', 'Pointer', '=', '0x00000103', 'ULONG', 'Status', '=', '12855664', 'ULONG', 'Information', '=', '12855664', 'PIO_STATUS_BLOCK', 'IoStatusBlock', '=', [ 'PVOID', 'Pointer', '=', '0x00000103', 'ULONG', 'Status', '=', '12855664', 'ULONG', 'Information', '=', '12855664', 'PUNICODE_STRING', 'ObjectName', '=', '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Srp\\GP\\DLL']]]] # Kinda lame but at least we have it self.assertTrue(str(ret) == str(expected))
def test_point_struct(self): ret = get_grammar().parseString(FIXTURE_POINT) expected = ['A', 'a', '=', ['B', 'a.b.c.d', '=', '24', 'C', 'e.f.g.h', '=', '42']] self.assertTrue(str(ret) == str(expected))