Exemplo n.º 1
0
def ftp(request, config, envName):
    anytest.ensureSupportedEnv(envName, ['dev-local'])
    usr = readVerifyOptVal(request, "--ftpuid")
    pwd = readVerifyOptVal(request, "--ftppwd")
    ftp = FTP()
    ftp.connect(config['FTP_HOST'], config['FTP_PORT'])
    ftp.login(usr, pwd)
    yield ftp
    ftp.quit()
Exemplo n.º 2
0
def test_deleteInsertSelect(envName, dbConn):
    anytest.ensureSupportedEnv(envName, ['dev-local'])

    if (envName.lower() != 'dev-local'):
        pytest.skip(f'only "dev-local" environment supported but not env={envName}')
    cursor, _ = dbConn
    table = 'Table1'
    dbColumn = 'name'
    expectedValue = 'Yuri'

    cursor.execute(f'DELETE FROM {table}')
    cursor.execute(f"INSERT INTO {table}({dbColumn}) VALUES('{expectedValue}')")
    cursor.execute(f'SELECT * FROM {table}')
    rows = cursor.fetchall()

    assert len(rows) == 1
    autoId, name = rows[0]
    assert autoId > 0
    assert name == expectedValue
Exemplo n.º 3
0
def apiUrl(apiBaseUrl, envName):
    anytest.ensureSupportedEnv(envName, ['dev-local'])
    return f'{apiBaseUrl}/{ENDPOINT}'
Exemplo n.º 4
0
def apiCode(request, envName):
    anytest.ensureSupportedEnv(envName, [
        'tst-cloud',
    ])
    return readVerifyOptVal(request, "--apicode")
Exemplo n.º 5
0
def fileService(request, config, envName):
    anytest.ensureSupportedEnv(envName, ['dev-local', 'tst-cloud'])
    key = readVerifyOptVal(request, "--storekey")
    return FileService(account_name=config['STORAGE_ACCOUNT'], account_key=key)