Skip to content

Commit

Permalink
chore: fix proto converter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Aug 15, 2024
1 parent 4859e52 commit df97dac
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions internal/protoutil/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ func TestSnapshotToProto(t *testing.T) {
Username: "dontpanic",
Tags: []string{},
Parent: "",
SnapshotSummary: restic.SnapshotSummary{
FilesNew: 1,
FilesChanged: 2,
FilesUnmodified: 3,
DirsNew: 4,
DirsChanged: 5,
DirsUnmodified: 6,
DataBlobs: 7,
TreeBlobs: 8,
DataAdded: 9,
TotalFilesProcessed: 10,
TotalBytesProcessed: 11,
BackupStart: "2023-11-10T19:14:17.053824063-08:00",
BackupEnd: "2023-11-10T19:15:17.053824063-08:00",
},
}

want := &v1.ResticSnapshot{
Expand All @@ -29,6 +44,20 @@ func TestSnapshotToProto(t *testing.T) {
Username: "dontpanic",
Tags: []string{},
Parent: "",
Summary: &v1.SnapshotSummary{
FilesNew: 1,
FilesChanged: 2,
FilesUnmodified: 3,
DirsNew: 4,
DirsChanged: 5,
DirsUnmodified: 6,
DataBlobs: 7,
TreeBlobs: 8,
DataAdded: 9,
TotalFilesProcessed: 10,
TotalBytesProcessed: 11,
TotalDuration: 60.0,
},
}

got := SnapshotToProto(snapshot)
Expand Down

0 comments on commit df97dac

Please sign in to comment.