From b7e524baf7ddf661ba3da2e8181f77d36558ea30 Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Sun, 20 Oct 2024 21:34:57 +0000 Subject: [PATCH] test(backup): fix test --- services/project/backup_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/project/backup_test.go b/services/project/backup_test.go index 11c82d49..74ba34fa 100644 --- a/services/project/backup_test.go +++ b/services/project/backup_test.go @@ -1,10 +1,11 @@ package project import ( + "testing" + "github.com/ansible-semaphore/semaphore/db" "github.com/ansible-semaphore/semaphore/db/bolt" "github.com/ansible-semaphore/semaphore/util" - "testing" ) type testItem struct { @@ -87,7 +88,7 @@ func TestBackupProject(t *testing.T) { t.Fatal(err) } - if str != `{"environments":[{"json":"{\"author\": \"Denis\", \"comment\": \"Hello, World!\"}","name":"test"}],"integration_aliases":[],"integrations":[],"inventories":[{"inventory":"","name":"","type":""}],"keys":[{"name":"","type":"none"}],"meta":{"alert":false,"max_parallel_tasks":0,"name":"Test 123","type":""},"repositories":[{"git_branch":"master","git_url":"git@example.com:test/test","name":"Test","ssh_key":""}],"templates":[{"allow_override_args_in_task":false,"app":"","autorun":false,"environment":"test","inventory":"","name":"Test","playbook":"test.yml","repository":"Test","suppress_success_alerts":false,"type":"","vaults":[]}],"views":[]}` { + if str != "{\"environments\":[{\"json\":\"{\\\"author\\\": \\\"Denis\\\", \\\"comment\\\": \\\"Hello, World!\\\"}\",\"name\":\"test\"}],\"integration_aliases\":[],\"integrations\":[],\"inventories\":[{\"inventory\":\"\",\"name\":\"\",\"type\":\"\"}],\"keys\":[{\"name\":\"\",\"type\":\"none\"}],\"meta\":{\"alert\":false,\"max_parallel_tasks\":0,\"name\":\"Test 123\",\"type\":\"\"},\"repositories\":[{\"git_branch\":\"master\",\"git_url\":\"git@example.com:test/test\",\"name\":\"Test\",\"ssh_key\":\"\"}],\"templates\":[{\"allow_override_args_in_task\":false,\"app\":\"\",\"autorun\":false,\"environment\":\"test\",\"inventory\":\"\",\"name\":\"Test\",\"playbook\":\"test.yml\",\"repository\":\"Test\",\"suppress_success_alerts\":false,\"survey_vars\":[],\"type\":\"\",\"vaults\":[]}],\"views\":[]}" { t.Fatal("Invalid backup content") }