def test_onlyhostset_none(mocker): mocker.patch.dict(os.environ,{'DATABRICKS_HOST':'host'}) mocker.patch.dict(os.environ,{'DATABRICKS_TOKEN':''}) config = auth.get_auth_config() # Assert assert config == None
def test_tokenhostset_okay(mocker): mocker.patch.dict(os.environ,{'DATABRICKS_HOST':'host'}) mocker.patch.dict(os.environ,{'DATABRICKS_TOKEN':'token'}) config = auth.get_auth_config() # Assert assert config != None assert config.host == 'host' assert config.token == 'token'