88
99 "github.com/ActiveState/cli/internal/environment"
1010 "github.com/ActiveState/cli/internal/fileutils"
11- "github.com/go-openapi/strfmt"
1211 "github.com/stretchr/testify/assert"
1312 "github.com/stretchr/testify/require"
1413)
@@ -118,7 +117,7 @@ func TestRoundTripFromBuildExpressionWithLegacyAtTime(t *testing.T) {
118117 // Ensure that legacy at_time is preserved in the buildscript.
119118 atTime := script .AtTime ()
120119 require .NotNil (t , atTime )
121- require .Equal (t , initialTimeStamp , atTime .Format (strfmt . RFC3339Millis ))
120+ require .Equal (t , initialTimeStamp , atTime .Format (time . RFC3339 ))
122121
123122 data , err = script .MarshalBuildExpression ()
124123 require .NoError (t , err )
@@ -128,12 +127,12 @@ func TestRoundTripFromBuildExpressionWithLegacyAtTime(t *testing.T) {
128127 assert .NotContains (t , string (data ), initialTimeStamp )
129128
130129 // Update the time in the build script but don't override the existing time
131- updatedTime , err := time .Parse (strfmt . RFC3339Millis , updatedTimeStamp )
130+ updatedTime , err := time .Parse (time . RFC3339 , updatedTimeStamp )
132131 require .NoError (t , err )
133132 script .SetAtTime (updatedTime , false )
134133
135134 // The updated time should be reflected in the build script
136- require .Equal (t , initialTimeStamp , script .AtTime ().Format (strfmt . RFC3339Millis ))
135+ require .Equal (t , initialTimeStamp , script .AtTime ().Format (time . RFC3339 ))
137136
138137 data , err = script .Marshal ()
139138 require .NoError (t , err )
@@ -145,7 +144,7 @@ func TestRoundTripFromBuildExpressionWithLegacyAtTime(t *testing.T) {
145144
146145 // Now override the time in the build script
147146 script .SetAtTime (updatedTime , true )
148- require .Equal (t , updatedTimeStamp , script .AtTime ().Format (strfmt . RFC3339Millis ))
147+ require .Equal (t , updatedTimeStamp , script .AtTime ().Format (time . RFC3339 ))
149148
150149 data , err = script .Marshal ()
151150 require .NoError (t , err )
@@ -165,7 +164,7 @@ func TestRoundTripFromBuildExpressionWithLegacyAtTime(t *testing.T) {
165164// TestExpressionToScript tests that creating a build script from a given Platform build expression
166165// and at time produces the expected result.
167166func TestExpressionToScript (t * testing.T ) {
168- ts , err := time .Parse (strfmt . RFC3339Millis , testTime )
167+ ts , err := time .Parse (time . RFC3339 , testTime )
169168 require .NoError (t , err )
170169
171170 script := New ()
@@ -193,7 +192,7 @@ func TestScriptToExpression(t *testing.T) {
193192
194193func TestOutdatedScript (t * testing.T ) {
195194 _ , err := Unmarshal ([]byte (
196- `at_time = "2000-01-01T00:00:00.000Z "
195+ `at_time = "2000-01-01T00:00:00Z "
197196 main = runtime
198197 ` ))
199198 assert .Error (t , err )
0 commit comments