diff options
Diffstat (limited to 'internal/cli/profile_test.go')
| -rw-r--r-- | internal/cli/profile_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/cli/profile_test.go b/internal/cli/profile_test.go index c9b1274..e08ffc5 100644 --- a/internal/cli/profile_test.go +++ b/internal/cli/profile_test.go @@ -70,6 +70,15 @@ func TestProfileImport(t *testing.T) { if _, err := os.Stat(destCustomFile); os.IsNotExist(err) { t.Errorf("expected profile to be imported to %s", destCustomFile) } + + // 3. Test duplicate import (should fail) + appDup := NewApp([]string{"wg-wrap", "profile", "import", srcFile, customName}) + appDup.ConfigDir = profilesDir + + err = appDup.Route() + if err == nil { + t.Errorf("expected error when importing duplicate profile, got nil") + } } func TestProfileDelete(t *testing.T) { |
