#8759: Fixed user paths in sysconfig for posix and os2 schemes
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 1e12a45..88722de 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -17,7 +17,7 @@
 from sysconfig import (get_paths, get_platform, get_config_vars,
                        get_path, get_path_names, _INSTALL_SCHEMES,
                        _get_default_scheme, _expand_vars,
-                       get_scheme_names)
+                       get_scheme_names, get_config_var)
 
 class TestSysConfig(unittest.TestCase):
 
@@ -255,6 +255,15 @@
         finally:
             unlink(link)
 
+    def test_user_similar(self):
+        # Issue 8759 : make sure the posix scheme for the users
+        # is similar to the global posix_prefix one
+        base = get_config_var('base')
+        user = get_config_var('userbase')
+        for name in ('stdlib', 'platstdlib', 'purelib', 'platlib'):
+            global_path = get_path(name, 'posix_prefix')
+            user_path = get_path(name, 'posix_user')
+            self.assertEquals(user_path, global_path.replace(base, user))
 
 def test_main():
     run_unittest(TestSysConfig)