@@ -63,16 +63,15 @@ services:
63
63
- "mysqlexhost:10.0.0.0"`
64
64
65
65
tmpfile , err := ioutil .TempFile ("" , "test" )
66
- if err != nil {
67
- t .Fatal ("Unexpected error in creating test file: " , err )
68
- }
66
+ assert .NoError (t , err , "Unexpected error in creating test file" )
67
+
69
68
defer os .Remove (tmpfile .Name ())
70
69
71
70
_ , err = tmpfile .Write ([]byte (composeFileString ))
72
- assert .NoError (t , err , "Unexpected error parsing file" )
71
+ assert .NoError (t , err , "Unexpected error writing file" )
73
72
74
73
err = tmpfile .Close ()
75
- assert .NoError (t , err , "Unexpected error parsing file" )
74
+ assert .NoError (t , err , "Unexpected error closing file" )
76
75
77
76
// add files to projects
78
77
project := setupTestProject (t )
@@ -83,9 +82,8 @@ services:
83
82
84
83
// assert # and content of container configs matches expected services
85
84
actualConfigs , err := project .parseV3 ()
86
- if err != nil {
87
- t .Fatal ("Unexpected error parsing file: " , err )
88
- }
85
+ assert .NoError (t , err , "Unexpected error parsing file" )
86
+
89
87
assert .Equal (t , len (expectedConfigs ), len (* actualConfigs ))
90
88
for _ , containerConfig := range * actualConfigs {
91
89
verifyConvertToContainerConfigOutput (t , expectedConfigs [containerConfig .Name ], containerConfig )
0 commit comments