Codebase list pysmb / ee8fe3c1-b719-4ebc-9bd1-fd13dd5f50c6/upstream python2 / tests / SMBConnectionTests / test_with_context.py
ee8fe3c1-b719-4ebc-9bd1-fd13dd5f50c6/upstream

Tree @ee8fe3c1-b719-4ebc-9bd1-fd13dd5f50c6/upstream (Download .tar.gz)

test_with_context.py @ee8fe3c1-b719-4ebc-9bd1-fd13dd5f50c6/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