diff tests/fsmonitor-run-tests.py @ 44468:55c443fcb4fc

tests: rename _bytespath() to _sys2bytes() and _strpath() to _sys2str() The names were not general enough because e.g. _strpath() was used for converting IP addresses.
author Manuel Jacob <me@manueljacob.de>
date Fri, 06 Mar 2020 09:50:57 +0100
parents 2372284d9457
children c102b704edb5
line wrap: on
line diff
--- a/tests/fsmonitor-run-tests.py	Thu Mar 05 18:19:21 2020 +0100
+++ b/tests/fsmonitor-run-tests.py	Fri Mar 06 09:50:57 2020 +0100
@@ -30,7 +30,7 @@
     PYTHON3 = True
     xrange = range  # we use xrange in one place, and we'd rather not use range
 
-    def _bytespath(p):
+    def _sys2bytes(p):
         return p.encode('utf-8')
 
 
@@ -47,7 +47,7 @@
     # bytestrings by default, so we don't have to do any extra
     # fiddling there. We define the wrapper functions anyway just to
     # help keep code consistent between platforms.
-    def _bytespath(p):
+    def _sys2bytes(p):
         return p
 
 
@@ -107,7 +107,7 @@
         ]
 
         envb = osenvironb.copy()
-        envb[b'WATCHMAN_CONFIG_FILE'] = _bytespath(cfgfile)
+        envb[b'WATCHMAN_CONFIG_FILE'] = _sys2bytes(cfgfile)
         with open(clilogfile, 'wb') as f:
             proc = subprocess.Popen(
                 argv, env=envb, stdin=None, stdout=f, stderr=f
@@ -129,7 +129,7 @@
     args, runtestsargv = parser.parse_known_args()
 
     with watchman(args) as sockfile:
-        osenvironb[b'WATCHMAN_SOCK'] = _bytespath(sockfile)
+        osenvironb[b'WATCHMAN_SOCK'] = _sys2bytes(sockfile)
         # Indicate to hghave that we're running with fsmonitor enabled.
         osenvironb[b'HGFSMONITOR_TESTS'] = b'1'