Codebase list pysmb / c2d58d0d-f278-4794-bd5d-00f98684f4cd/main python3 / tests / SMBConnectionTests / test_with_context.py
c2d58d0d-f278-4794-bd5d-00f98684f4cd/main

Tree @c2d58d0d-f278-4794-bd5d-00f98684f4cd/main (Download .tar.gz)

test_with_context.py @c2d58d0d-f278-4794-bd5d-00f98684f4cd/mainraw · 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