Skip to content

Commit c503d15

Browse files
committed
tests
1 parent 9fd4c97 commit c503d15

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cli/templatepush.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,10 @@ func (r *RootCmd) templatePush() *clibase.Cmd {
189189
var createTemplate bool
190190
template, err := client.TemplateByName(inv.Context(), organization.ID, name)
191191
if err != nil {
192-
if create {
193-
createTemplate = true
194-
} else {
192+
if !create {
195193
return err
196194
}
195+
createTemplate = true
197196
}
198197

199198
err = uploadFlags.checkForLockfile(inv)

cli/templatepush_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,10 +644,13 @@ func TestTemplatePush(t *testing.T) {
644644
write string
645645
}{
646646
{match: "Upload", write: "yes"},
647+
{match: "template has been created"},
647648
}
648649
for _, m := range matches {
649650
pty.ExpectMatch(m.match)
650-
pty.WriteLine(m.write)
651+
if m.write != "" {
652+
pty.WriteLine(m.write)
653+
}
651654
}
652655

653656
waiter.RequireSuccess()

0 commit comments

Comments
 (0)