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"]
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"])
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']
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'])
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"])
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'])