Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 43a30b7

Browse files
williexutroydai
authored andcommitted
url parsing fix
1 parent 9c3ceae commit 43a30b7

File tree

1 file changed

+6
-0
lines changed
  • src/azure_devtools/scenario_tests

1 file changed

+6
-0
lines changed

src/azure_devtools/scenario_tests/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import logging
1313
import six
1414
import vcr
15+
import re
1516

1617
from .config import TestConfig
1718
from .const import ENV_TEST_DIAGNOSE
@@ -142,6 +143,11 @@ def tearDown(self):
142143
os.environ = self.original_env
143144

144145
def _process_request_recording(self, request):
146+
# URL parsing fix to account for '//' vs '/' in different versions of python
147+
# - Python 2.7 for 2.7/3.3/3.4 (...Microsoft.Compute//availabilitySets...)
148+
# - Python 3.5 (...Microsoft.Compute/availabilitySets...)
149+
request.uri = re.sub('(?<!:)//', '/', request.uri)
150+
145151
if self.disable_recording:
146152
return None
147153

0 commit comments

Comments
 (0)