Skip to content

Commit

Permalink
swupd: Remove totalSteps from JSON
Browse files Browse the repository at this point in the history
Remove totalSteps from swupd JSON message to align with swupd's removal
of this entry.

Signed-off-by: John Akre <[email protected]>
  • Loading branch information
John Akre committed Oct 16, 2019
1 parent 1dd110d commit 0f9f5b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion swupd/swupd.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ type Message struct {
Section string `json:"section"`
Status int `json:"status"`
CurrentStep int `json:"currentStep"`
TotalSteps int `json:"totalSteps"`
StepCompletion int `json:"stepCompletion"`
StepDescription string `json:"stepDescription"`
}
Expand Down
4 changes: 2 additions & 2 deletions swupd/swupd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestProcess(t *testing.T) {
}

// "progress" messages should be processed correctly
jsonMsg = "{ \"type\" : \"progress\", \"currentStep\" : 5, \"totalSteps\" : 8, \"stepCompletion\" : 80, \"stepDescription\" : \"download_packs\" },"
jsonMsg = "{ \"type\" : \"progress\", \"currentStep\" : 5, \"stepCompletion\" : 80, \"stepDescription\" : \"download_packs\" },"
msg.Process("", jsonMsg)
if mp.description != "Downloading required packs" {
t.Fatal("Message processed incorrectly. Expected: 'Downloading required packs', Actual:", mp.description)
Expand All @@ -180,7 +180,7 @@ func TestProcess(t *testing.T) {
if mp.output != "" {
t.Fatal("Message processed incorrectly. Expected: '', Actual:", mp.output)
}
jsonMsg = "{ \"type\" : \"progress\", \"currentStep\" : 8, \"totalSteps\" : 8, \"stepCompletion\" : 100, \"stepDescription\" : \"add_missing_files\" },"
jsonMsg = "{ \"type\" : \"progress\", \"currentStep\" : 8, \"stepCompletion\" : 100, \"stepDescription\" : \"add_missing_files\" },"
msg.Process("", jsonMsg)
if mp.description != "Installing base OS and configured bundles" {
t.Fatal("Message processed incorrectly. Expected: 'Installing base OS and configured bundles', Actual:", mp.description)
Expand Down

0 comments on commit 0f9f5b5

Please sign in to comment.