mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
test(backup): restoring project
This commit is contained in:
parent
85ccc9fcef
commit
8168c547e2
@ -101,6 +101,28 @@ func TestBackupProject(t *testing.T) {
|
||||
t.Fatal("backup meta ID wrong")
|
||||
}
|
||||
|
||||
user, err := store.CreateUser(db.UserWithPwd{
|
||||
Pwd: "3412341234123",
|
||||
User: db.User{
|
||||
Username: "test",
|
||||
Name: "Test",
|
||||
Email: "test@example.com",
|
||||
Admin: true,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
restoredProj, err := restoredBackup.Restore(user, store)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if restoredProj.Name != proj.Name {
|
||||
t.Fatal("backup meta ID wrong")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func isUnique(items []testItem) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user