Пример #1
0
def test_has_all_three(config):
    cfg = ConfigParser()
    cfg.read(config)
    section = cfg["bar"]

    w = Workspace("bar", config)
    assert w.home == section["home"]
    assert w.host == databricks._fix_host(section["host"])
    assert w.token == section["token"]
Пример #2
0
def test_default(config_with_default):
    cfg = ConfigParser()
    cfg.read(config_with_default)
    default = cfg["DEFAULT"]

    w = Workspace(config=config_with_default)
    assert w.token == default["token"]
    assert w.home == default["home"]
    assert w.host == databricks._fix_host(default["host"])
Пример #3
0
def test_has_all_three(config):
    cfg = ConfigParser()
    cfg.read(config)
    section = cfg['bar']

    w = Workspace('bar', config)
    assert w.home == section['home']
    assert w.host == databricks._fix_host(section['host'])
    assert w.token == section['token']
Пример #4
0
def test_default(config_with_default):
    cfg = ConfigParser()
    cfg.read(config_with_default)
    default = cfg['DEFAULT']

    w = Workspace(config=config_with_default)
    assert w.token == default['token']
    assert w.home == default['home']
    assert w.host == databricks._fix_host(default['host'])
Пример #5
0
def test_default_with_missing_home(config_with_default):
    cfg = ConfigParser()
    cfg.read(config_with_default)
    default = cfg["DEFAULT"]
    section = cfg["missing_home"]

    w = Workspace("missing_home", config_with_default)
    assert w.token == section["token"]
    assert w.home == default["home"]
    assert w.host == databricks._fix_host(section["host"])
Пример #6
0
def test_default_with_missing_home(config_with_default):
    cfg = ConfigParser()
    cfg.read(config_with_default)
    default = cfg['DEFAULT']
    section = cfg['missing_home']

    w = Workspace('missing_home', config_with_default)
    assert w.token == section['token']
    assert w.home == default['home']
    assert w.host == databricks._fix_host(section['host'])