'Test that the sys.executable value is as expected.'

@skipInVenv
def test_executable(self):

    shutil.rmtree(self.env_dir)
    self.run_with_capture(venv.create, self.env_dir)
    envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe)
    cmd = [envpy, '-c', 'import    sys;    print(sys.executable)']
    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (out, err) = p.communicate()
    self.assertEqual(out.strip(), envpy.encode())
