Codebase list pysmb / 10506b22-4123-4f57-b3e9-0b68034318e8/upstream/1.1.26 python3 / tests / SMBConnectionTests / test_with_context.py
10506b22-4123-4f57-b3e9-0b68034318e8/upstream/1.1.26

Tree @10506b22-4123-4f57-b3e9-0b68034318e8/upstream/1.1.26 (Download .tar.gz)

test_with_context.py @10506b22-4123-4f57-b3e9-0b68034318e8/upstream/1.1.26raw · history · blame

# -*- coding: utf-8 -*-

from smb.SMBConnection import SMBConnection
from .util import getConnectionInfo

def test_context():
    info = getConnectionInfo()
    with SMBConnection(info['user'], info['password'], info['client_name'], info['server_name'], use_ntlm_v2 = True) as conn:
        assert conn.connect(info['server_ip'], info['server_port'])

    assert conn.sock is None