1414
1515from http import HTTPStatus
1616
17- from opentelemetry .instrumentation .utils import _python_path_without_current_directory , http_status_to_status_code
17+ from opentelemetry .instrumentation .utils import (
18+ _python_path_without_directory ,
19+ http_status_to_status_code ,
20+ )
1821from opentelemetry .test .test_base import TestBase
1922from opentelemetry .trace import StatusCode
2023
@@ -113,26 +116,39 @@ def test_http_status_to_status_code_server(self):
113116 self .assertEqual (actual , expected , status_code )
114117
115118 def test_remove_current_directory_from_python_path_windows (self ):
116- dir = r"c:\users\trayvonmartin \workplace\opentelemetry-python-contrib\opentelemetry-instrumentation\src\opentelemetry\instrumentation\auto_instrumentation"
119+ dir = r"c:\users\Trayvon Martin \workplace\opentelemetry-python-contrib\opentelemetry-instrumentation\src\opentelemetry\instrumentation\auto_instrumentation"
117120 path_separator = r";"
118- python_path = r"c:\users\trayvonmartin\workplace\opentelemetry-python-contrib\opentelemetry-instrumentation\src\opentelemetry\instrumentation\auto_instrumentation;C:\Users\trayvonmartin\workplace"
119- actual_python_path = _python_path_without_current_directory (
120- python_path ,
121- dir ,
122- path_separator
121+ python_path = r"c:\users\Trayvon Martin\workplace\opentelemetry-python-contrib\opentelemetry-instrumentation\src\opentelemetry\instrumentation\auto_instrumentation;C:\Users\trayvonmartin\workplace"
122+ actual_python_path = _python_path_without_directory (
123+ python_path , dir , path_separator
123124 )
124125 expected_python_path = r"C:\Users\trayvonmartin\workplace"
125- assert (expected_python_path == actual_python_path
126- )
126+ self .assertEqual (actual_python_path , expected_python_path )
127127
128128 def test_remove_current_directory_from_python_path_linux (self ):
129129 dir = r"/home/georgefloyd/workplace/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation"
130130 path_separator = r":"
131131 python_path = r"/home/georgefloyd/workplace/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation:/home/georgefloyd/workplace"
132- actual_python_path = _python_path_without_current_directory (
133- python_path ,
134- dir ,
135- path_separator
132+ actual_python_path = _python_path_without_directory (
133+ python_path , dir , path_separator
136134 )
137135 expected_python_path = r"/home/georgefloyd/workplace"
138- assert (expected_python_path == actual_python_path )
136+ self .assertEqual (actual_python_path , expected_python_path )
137+
138+ def test_remove_current_directory_from_python_path_windows_only_path (self ):
139+ dir = r"c:\users\Charleena Lyles\workplace\opentelemetry-python-contrib\opentelemetry-instrumentation\src\opentelemetry\instrumentation\auto_instrumentation"
140+ path_separator = r";"
141+ python_path = r"c:\users\Charleena Lyles\workplace\opentelemetry-python-contrib\opentelemetry-instrumentation\src\opentelemetry\instrumentation\auto_instrumentation"
142+ actual_python_path = _python_path_without_directory (
143+ python_path , dir , path_separator
144+ )
145+ self .assertEqual (actual_python_path , python_path )
146+
147+ def test_remove_current_directory_from_python_path_linux_only_path (self ):
148+ dir = r"/home/sandranland/workplace/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation"
149+ path_separator = r":"
150+ python_path = r"/home/SandraBland/workplace/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation"
151+ actual_python_path = _python_path_without_directory (
152+ python_path , dir , path_separator
153+ )
154+ self .assertEqual (actual_python_path , python_path )
0 commit comments