Skip to content

Commit

Permalink
URL quote the config directory for URI test
Browse files Browse the repository at this point in the history
This can be necessary if there are special characters in the
parent path.
  • Loading branch information
timj committed Dec 6, 2024
1 parent d66c8bb commit 60cf16e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_simpleButler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import re
import tempfile
import unittest
import urllib.parse
from typing import Any

try:
Expand Down Expand Up @@ -899,8 +900,9 @@ def test_dataset_uris(self):
ref = butler.find_dataset("flat", detector=2, physical_filter="Cam1-G")
self.assertIsInstance(ref, DatasetRef)

# Get the butler root for the URI.
config_dir = butler._config["root"]
# Get the butler root for the URI. It does have to be encoded
# in case there are special characters in the path.
config_dir = urllib.parse.quote(butler._config["root"])

# Read it via a repo label and a path.
with tempfile.NamedTemporaryFile(mode="w", suffix=".yaml") as index_file:
Expand Down

0 comments on commit 60cf16e

Please sign in to comment.