Add more precise assertions for installs from python scripts

This commit is contained in:
David Dworken 2023-12-22 07:41:44 -08:00
parent e5764c6f07
commit 4b058298b9
No known key found for this signature in database

View File

@ -1057,13 +1057,23 @@ func TestInstallViaPythonScriptInOfflineMode(t *testing.T) {
defer testutils.BackupAndRestore(t)()
defer testutils.BackupAndRestoreEnv("HISHTORY_OFFLINE")()
os.Setenv("HISHTORY_OFFLINE", "1")
tester := zshTester{}
testInstallViaPythonScriptChild(t, zshTester{})
// Check that installing works
testInstallViaPythonScriptChild(t, tester)
// And check that it installed in offline mode
out := tester.RunInteractiveShell(t, `hishtory status`)
require.Contains(t, out, "\nSync Mode: Disabled\n")
}
func testInstallViaPythonScript(t *testing.T, tester shellTester) {
defer testutils.BackupAndRestore(t)()
testInstallViaPythonScriptChild(t, tester)
// And check that it installed in online mode
out := tester.RunInteractiveShell(t, `hishtory status`)
require.Contains(t, out, "\nSync Mode: Enabled\n")
}
func testInstallViaPythonScriptChild(t *testing.T, tester shellTester) {