Files
thanks/internal/jobs/parse_test.go
2026-01-30 19:16:00 -05:00

27 lines
548 B
Go

package jobs_test
import (
"strings"
"testing"
"git.gentoo.party/sam/thanks/internal/jobs"
"github.com/stretchr/testify/assert"
)
const testParseStr = `
jobs:
- source: "zroot/home/sam/thanks"
target: "zrust/backup/weller/thanks"
targetHost: "backup@woodford.gentoo.party"
keep: 30
prefix: "thanks-"
recursive: false
`
func TestParse(t *testing.T) {
reader := strings.NewReader(testParseStr)
backupJobs, err := jobs.Parse(reader)
assert.Nil(t, err)
assert.Equal(t, backupJobs[0].Source, "zroot/home/sam/thanks")
}