Skip to content

Commit

Permalink
Fix #58 - '?' not ok in filenames on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lcosmin committed Jun 12, 2019
1 parent 457ff50 commit 504f56c
Show file tree
Hide file tree
Showing 65 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/_common.py
Expand Up @@ -103,20 +103,21 @@ def simulate_bgg(url, params, timeout):
sorted_params = sorted(params.items(), key=lambda t: t[0])
query_string = '&'.join([str(k) + "=" + str(v) for k, v in sorted_params])

filename = os.path.join(XML_PATH, fragment + "?" + query_string)
filename = os.path.join(XML_PATH, fragment + "@" + query_string)

with io.open(filename, "r", encoding="utf-8") as xmlfile:
response_text = xmlfile.read()

return MockResponse(response_text)


def simulate_legacy_bgg(url, params, timeout):
fragment = re.search(r"(?:/)([^/]*/[^/]*)$", url).group(1).replace('/', '%25')

if len(params)>0:
sorted_params = sorted(params.items(), key=lambda t: t[0])
query_string = '&'.join([str(k) + "=" + str(v) for k, v in sorted_params])
fragment = fragment + "?" + query_string
fragment = fragment + "@" + query_string

xml_filename = os.path.join(XML_PATH, fragment)
with io.open(xml_filename, "r", encoding="utf-8") as xmlfile:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 504f56c

Please sign in to comment.