| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6f3f357 commit e200cae
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,9 @@ init: | |||
| 27 | 27 | # Put desired Python version first in PATH | |
| 28 | 28 | - set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% | |
| 29 | 29 | ||
| 30 | + # Needed for test `GetPythonHomeDefault` | ||
| 31 | + - set PYTHONHOME=%PYTHON% | ||
| 32 | + | ||
| 30 | 33 | install: | |
| 31 | 34 | - pip install --upgrade -r requirements.txt --quiet | |
| 32 | 35 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,5 +66,44 @@ public static void GetVersionDoesntCrash() | |||
| 66 | 66 | Assert.IsTrue(s.Contains(",")); | |
| 67 | 67 | } | |
| 68 | 68 | } | |
| 69 | + | ||
| 70 | + [Test] | ||
| 71 | + public static void GetPythonPathDefault() | ||
| 72 | + { | ||
| 73 | + PythonEngine.Initialize(); | ||
| 74 | + string s = PythonEngine.PythonPath; | ||
| 75 | + | ||
| 76 | + StringAssert.Contains("python", s.ToLower()); | ||
| 77 | + PythonEngine.Shutdown(); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + [Test] | ||
| 81 | + public static void GetProgramNameDefault() | ||
| 82 | + { | ||
| 83 | + PythonEngine.Initialize(); | ||
| 84 | + string s = PythonEngine.PythonHome; | ||
| 85 | + | ||
| 86 | + Assert.NotNull(s); | ||
| 87 | + PythonEngine.Shutdown(); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + /// <summary> | ||
| 91 | + /// Test default behavior of PYTHONHOME. If ENVVAR is set it will | ||
| 92 | + /// return the same value. If not, returns EmptyString. | ||
| 93 | + /// </summary> | ||
| 94 | + /// <remarks> | ||
| 95 | + /// AppVeyor.yml has been update to tests with ENVVAR set. | ||
| 96 | + /// </remarks> | ||
| 97 | + [Test] | ||
| 98 | + public static void GetPythonHomeDefault() | ||
| 99 | + { | ||
| 100 | + string envPythonHome = Environment.GetEnvironmentVariable("PYTHONHOME") ?? ""; | ||
| 101 | + | ||
| 102 | + PythonEngine.Initialize(); | ||
| 103 | + string enginePythonHome = PythonEngine.PythonHome; | ||
| 104 | + | ||
| 105 | + Assert.AreEqual(envPythonHome, enginePythonHome); | ||
| 106 | + PythonEngine.Shutdown(); | ||
| 107 | + } | ||
| 69 | 108 | } | |
| 70 | 109 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments