Пример #1
0
def test_configuration_override_work_with_empty_password():
    kpc = { 'username': '******', 'base64_password': '', 'password': '', 'url': '' }
    overrides = { conf.kernel_python_credentials.__name__: kpc }
    conf.override_all(overrides)
    conf.override(conf.status_sleep_seconds.__name__, 1)
    assert_equals(conf.d, { conf.kernel_python_credentials.__name__: kpc,
                                     conf.status_sleep_seconds.__name__: 1 })
    assert_equals(conf.status_sleep_seconds(), 1)
    assert_equals(conf.base64_kernel_python_credentials(),  { 'username': '******', 'password': '', 'url': '' })
Пример #2
0
def test_configuration_auth_missing_no_auth():
    kpc = {'username': '', 'password': '', 'url': 'L'}
    overrides = {conf.kernel_python_credentials.__name__: kpc}
    conf.override_all(overrides)
    assert_equals(conf.base64_kernel_python_credentials(), {
        'username': '',
        'password': '',
        'url': 'L',
        'auth': NO_AUTH
    })
Пример #3
0
def test_share_config_between_pyspark_and_pyspark3():
    kpc = {
        'username': '******',
        'password': '******',
        'base64_password': '******',
        'url': 'L'
    }
    overrides = {conf.kernel_python_credentials.__name__: kpc}
    assert_equals(conf.base64_kernel_python3_credentials(),
                  conf.base64_kernel_python_credentials())
Пример #4
0
def test_configuration_override_fallback_to_password():
    kpc = {'username': '******', 'password': '******', 'url': 'L', 'auth': NO_AUTH}
    overrides = {conf.kernel_python_credentials.__name__: kpc}
    conf.override_all(overrides)
    conf.override(conf.livy_session_startup_timeout_seconds.__name__, 1)
    assert_equals(
        conf.d, {
            conf.kernel_python_credentials.__name__: kpc,
            conf.livy_session_startup_timeout_seconds.__name__: 1
        })
    assert_equals(conf.livy_session_startup_timeout_seconds(), 1)
    assert_equals(conf.base64_kernel_python_credentials(), kpc)
Пример #5
0
def test_configuration_override_fallback_to_password():
    kpc = {'username': '******', 'password': '******', 'url': 'L'}
    overrides = {conf.kernel_python_credentials.__name__: kpc}
    conf.override_all(overrides)
    conf.override(conf.status_sleep_seconds.__name__, 1)
    assert_equals(
        conf.d, {
            conf.kernel_python_credentials.__name__: kpc,
            conf.status_sleep_seconds.__name__: 1
        })
    assert_equals(conf.status_sleep_seconds(), 1)
    assert_equals(conf.base64_kernel_python_credentials(), kpc)
Пример #6
0
def test_configuration_override_work_with_empty_password():
    kpc = {
        'username': '******',
        'base64_password': '',
        'password': '',
        'url': '',
        'auth': AUTH_BASIC
    }
    overrides = {conf.kernel_python_credentials.__name__: kpc}
    conf.override_all(overrides)
    conf.override(conf.livy_session_startup_timeout_seconds.__name__, 1)
    assert_equals(
        conf.d, {
            conf.kernel_python_credentials.__name__: kpc,
            conf.livy_session_startup_timeout_seconds.__name__: 1
        })
    assert_equals(conf.livy_session_startup_timeout_seconds(), 1)
    assert_equals(conf.base64_kernel_python_credentials(), {
        'username': '******',
        'password': '',
        'url': '',
        'auth': AUTH_BASIC
    })
Пример #7
0
def test_configuration_override_base64_password():
    kpc = {
        'username': '******',
        'password': '******',
        'base64_password': '******',
        'url': 'L',
        "auth": AUTH_BASIC
    }
    overrides = {conf.kernel_python_credentials.__name__: kpc}
    conf.override_all(overrides)
    conf.override(conf.status_sleep_seconds.__name__, 1)
    assert_equals(
        conf.d, {
            conf.kernel_python_credentials.__name__: kpc,
            conf.status_sleep_seconds.__name__: 1
        })
    assert_equals(conf.status_sleep_seconds(), 1)
    assert_equals(conf.base64_kernel_python_credentials(), {
        'username': '******',
        'password': '******',
        'url': 'L',
        'auth': AUTH_BASIC
    })
Пример #8
0
def test_configuration_raise_error_for_bad_base64_password():
    kpc = { 'username': '******', 'base64_password': '******', 'url': 'L' }
    overrides = { conf.kernel_python_credentials.__name__: kpc }
    conf.override_all(overrides)
    conf.override(conf.status_sleep_seconds.__name__, 1)
    conf.base64_kernel_python_credentials()
def test_share_config_between_pyspark_and_pyspark3():
    kpc = { 'username': '******', 'password': '******', 'base64_password': '******', 'url': 'L' }
    overrides = { conf.kernel_python_credentials.__name__: kpc }
    assert_equals(conf.base64_kernel_python3_credentials(), conf.base64_kernel_python_credentials())
Пример #10
0
def test_configuration_raise_error_for_bad_base64_password():
    kpc = {'username': '******', 'base64_password': '******', 'url': 'L'}
    overrides = {conf.kernel_python_credentials.__name__: kpc}
    conf.override_all(overrides)
    conf.override(conf.livy_session_startup_timeout_seconds.__name__, 1)
    conf.base64_kernel_python_credentials()