mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 11:57:50 +02:00
Add more precise assertions for installs from python scripts
This commit is contained in:
parent
e5764c6f07
commit
4b058298b9
@ -1057,13 +1057,23 @@ func TestInstallViaPythonScriptInOfflineMode(t *testing.T) {
|
|||||||
defer testutils.BackupAndRestore(t)()
|
defer testutils.BackupAndRestore(t)()
|
||||||
defer testutils.BackupAndRestoreEnv("HISHTORY_OFFLINE")()
|
defer testutils.BackupAndRestoreEnv("HISHTORY_OFFLINE")()
|
||||||
os.Setenv("HISHTORY_OFFLINE", "1")
|
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) {
|
func testInstallViaPythonScript(t *testing.T, tester shellTester) {
|
||||||
defer testutils.BackupAndRestore(t)()
|
defer testutils.BackupAndRestore(t)()
|
||||||
testInstallViaPythonScriptChild(t, tester)
|
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) {
|
func testInstallViaPythonScriptChild(t *testing.T, tester shellTester) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user