mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-18 02:40:33 +02:00
in progress integration tests
This commit is contained in:
@@ -11,14 +11,14 @@ func TestSetup(t *testing.T) {
|
||||
defer BackupAndRestore(t)
|
||||
homedir, err := os.UserHomeDir()
|
||||
Check(t, err)
|
||||
if _, err := os.Stat(path.Join(homedir, SECRET_PATH)); err == nil {
|
||||
if _, err := os.Stat(path.Join(homedir, CONFIG_PATH)); err == nil {
|
||||
t.Fatalf("hishtory secret file already exists!")
|
||||
}
|
||||
Check(t, Setup([]string{}))
|
||||
if _, err := os.Stat(path.Join(homedir, SECRET_PATH)); err != nil {
|
||||
if _, err := os.Stat(path.Join(homedir, CONFIG_PATH)); err != nil {
|
||||
t.Fatalf("hishtory secret file does not exist after Setup()!")
|
||||
}
|
||||
data, err := os.ReadFile(path.Join(homedir, SECRET_PATH))
|
||||
data, err := os.ReadFile(path.Join(homedir, CONFIG_PATH))
|
||||
Check(t, err)
|
||||
if len(data) < 10 {
|
||||
t.Fatalf("hishtory secret has unexpected length: %d", len(data))
|
||||
|
Reference in New Issue
Block a user