mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-14 09:08:44 +02:00
Run local server for TestAugmentedIsOfflineError and ensure that HISHTORY_TEST is set
This commit is contained in:
@ -15,6 +15,12 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
// Set env variable
|
||||||
|
defer testutils.BackupAndRestoreEnv("HISHTORY_TEST")()
|
||||||
|
os.Setenv("HISHTORY_TEST", "1")
|
||||||
|
}
|
||||||
|
|
||||||
func TestSetup(t *testing.T) {
|
func TestSetup(t *testing.T) {
|
||||||
defer testutils.BackupAndRestore(t)()
|
defer testutils.BackupAndRestore(t)()
|
||||||
defer testutils.RunTestServer()()
|
defer testutils.RunTestServer()()
|
||||||
@ -359,6 +365,8 @@ func TestSplitEscaped(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAugmentedIsOfflineError(t *testing.T) {
|
func TestAugmentedIsOfflineError(t *testing.T) {
|
||||||
|
defer testutils.BackupAndRestore(t)()
|
||||||
|
defer testutils.RunTestServer()()
|
||||||
defer testutils.BackupAndRestoreEnv("HISHTORY_SIMULATE_NETWORK_ERROR")()
|
defer testutils.BackupAndRestoreEnv("HISHTORY_SIMULATE_NETWORK_ERROR")()
|
||||||
|
|
||||||
// By default, when the hishtory server is up, then IsOfflineError checks the error msg
|
// By default, when the hishtory server is up, then IsOfflineError checks the error msg
|
||||||
|
Reference in New Issue
Block a user