@@ -131,6 +131,11 @@ func (h *FakeTransportHandler) ClearErrors() {
131131 h .ErrorMap = make (map [string ]sl.Error )
132132}
133133
134+ func (h * FakeTransportHandler ) SetFileNames (files []string ) {
135+ h .FileNames = files
136+ // fmt.Printf("SetFileNames: %v\n", h.FileNames)
137+ }
138+
134139func NewFakeSoftlayerSession (fileNames []string ) * session.Session {
135140
136141 sess := & session.Session {}
@@ -174,24 +179,25 @@ func readJsonTestFixtures(service string, method string, fileNames []string, ide
174179 }
175180 // fmt.Printf("WD: %v, Scope: %v", wd, scope)
176181 baseFixture := filepath .Join (wd , scope , "testfixtures" , service + "/" + method + ".json" )
182+ // fmt.Printf("BASE FIXTURE: %v\n", baseFixture)
177183
178184 // If we specified a file name, check there first
179185 if len (fileNames ) > 0 {
180186 //find the file name that matches the service and method name
181187 for _ , filename := range fileNames {
182- //fmt.Println("check file:" + filename)
188+ // fmt.Println("check file:" + filename)
183189 // If the file exists as is, just load and return it.
184190 // actual path should be of the format testfixtures/SoftLayer_Service/method-string.json
185191 workingPath = service + "/" + filename + ".json"
186192 // Make sure the filepath starts with the service/method combo
187193 if ! strings .HasPrefix (workingPath , service + "/" + method ) {
188- fmt .Printf ("OK %v doesn't start with %v\n " , workingPath , service + "/" + method )
194+ // fmt.Printf("OK %v doesn't start with %v\n", workingPath, service + "/" + method)
189195 continue
190196 }
191- fmt .Printf ("OK %v DOES INFACT start with %v\n " , workingPath , service + "/" + method )
197+ // fmt.Printf("OK %v DOES INFACT start with %v\n", workingPath, service + "/" + method)
192198 if _ , err := os .Stat (filepath .Join (wd , scope , "testfixtures" , workingPath )); err == nil {
193199 fixture = filepath .Join (wd , scope , "testfixtures" , workingPath )
194- fmt .Printf ("LOADED %v OK!\n " , fixture )
200+ // fmt.Printf("LOADED %v OK!\n", fixture)
195201 return ioutil .ReadFile (fixture ) // #nosec
196202 }
197203 }
0 commit comments