General helper functions
if not check_git_dir():
os.chdir("..") # we need this if we test locally in the notebook itself
input_credentials = "user = SomeUser\npassword = SomePassword"
expected_credentials = {"user": "SomeUser", "password": "SomePassword"}
with tempfile.TemporaryDirectory() as tmp_dir:
tmp_file = os.path.join(tmp_dir, "tmp")
with open(tmp_file, "w") as f:
f.write(input_credentials)
credentials = read_credentials(tmp_file)
assert credentials == expected_credentials