'Test that the prefix values are as expected.'

@skipInVenv
def test_prefixes(self):

    self.assertEqual(sys.base_prefix, sys.prefix)
    self.assertEqual(sys.base_exec_prefix, sys.exec_prefix)
    rmtree(self.env_dir)
    self.run_with_capture(venv.create, self.env_dir)
    envpy = os.path.join(self.env_dir, self.bindir, self.exe)
    cmd = [envpy, '-c', None]
    for (prefix, expected) in (('prefix', self.env_dir), ('prefix', self.env_dir), ('base_prefix', sys.prefix), ('base_exec_prefix', sys.exec_prefix)):
        cmd[2] = ('import    sys;    print(sys.%s)' % prefix)
        p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (out, err) = p.communicate()
        self.assertEqual(out.strip(), expected.encode())
