Codebase list pysmb / cef5f9b0-5906-4b59-b52b-1be0f99a7781/upstream python3 / tests / SMBConnectionTests / test_with_context.py
cef5f9b0-5906-4b59-b52b-1be0f99a7781/upstream

Tree @cef5f9b0-5906-4b59-b52b-1be0f99a7781/upstream (Download .tar.gz)

test_with_context.py @cef5f9b0-5906-4b59-b52b-1be0f99a7781/upstreamraw · 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