예제 #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'])