File tree Expand file tree Collapse file tree 3 files changed +36
-26
lines changed
Expand file tree Collapse file tree 3 files changed +36
-26
lines changed Original file line number Diff line number Diff line change 1+ < article >
2+ < section class ="License " id ="lic-0 ">
3+ < h2 class ="go-textTitle ">
4+ < div id ="#lic-0 "> Apache-2.0</ div >
5+ </ h2 >
6+ < p > This is not legal advice. < a href ="/license-policy "> Read disclaimer.</ a > </ p >
7+ < pre class ="License-contents "> Apache License
8+ Version 2.0, January 2004
9+ http://www.apache.org/licenses/
10+ </ pre >
11+ </ section >
12+ < section class ="License " id ="lic-1 ">
13+ < h2 class ="go-textTitle ">
14+ < div id ="#lic-1 "> BSD-2-Clause, BSD-3-Clause, HPND</ div >
15+ </ h2 >
16+ < p > This is not legal advice. < a href ="/license-policy "> Read disclaimer.</ a > </ p >
17+ < pre class ="License-contents "> Copyright (c) 2013-2019 Tommi Virtanen.
18+ Copyright (c) 2009, 2011, 2012 The Go Authors.
19+ All rights reserved.
20+ </ pre >
21+ </ section >
22+ </ article >
Original file line number Diff line number Diff line change @@ -312,14 +312,22 @@ describe('fetchDispatcher cache fetch result', () => {
312312 return `/go/${ fileName } `
313313 }
314314
315+ const httpContent = fs . readFileSync ( 'test/fixtures/go/license.html' )
316+ const successHttpStub = {
317+ get : sinon . stub ( ) . returns ( {
318+ status : 200 ,
319+ data : httpContent
320+ } )
321+ }
322+
315323 let fetchDispatcher
316324
317325 beforeEach ( ( ) => {
318326 const GoFetch = proxyquire ( '../../../../providers/fetch/goFetch' , {
319327 request : { get : createGetStub ( fileSupplier ) } ,
320328 'request-promise-native' : createRequestPromiseStub ( fileSupplier )
321329 } )
322- const fetch = GoFetch ( { logger : { info : sinon . stub ( ) } } )
330+ const fetch = GoFetch ( { logger : { info : sinon . stub ( ) } , http : successHttpStub } )
323331 fetchDispatcher = setupDispatcher ( fetch )
324332 } )
325333
@@ -382,6 +390,7 @@ describe('fetchDispatcher cache fetch result', () => {
382390 'request-promise-native' : sinon . stub ( ) . resolves ( loadJson ( 'pod/registryData.json' ) )
383391 } )
384392 const fetch = PodFetch ( { logger : { info : sinon . stub ( ) } } )
393+ fetch . _getPackage = sinon . stub ( ) . resolves ( '/tmp/cd-pYKk9q/SwiftLCS-1.0' )
385394 fetchDispatcher = setupDispatcher ( fetch )
386395 } )
387396
Original file line number Diff line number Diff line change @@ -69,34 +69,13 @@ describe('Go Proxy fetching', () => {
6969 response . end ( )
7070 return response
7171 }
72+
73+ const httpContent = fs . readFileSync ( 'test/fixtures/go/license.html' )
7274 successHttpStub = {
7375 get : sinon . stub ( ) . returns ( {
7476 status : 200 ,
75- data :
76- `<article>
77- <section class="License" id="lic-0">
78- <h2 class="go-textTitle">
79- <div id="#lic-0">Apache-2.0</div>
80- </h2>
81- <p>This is not legal advice. <a href="/license-policy">Read disclaimer.</a></p>
82- <pre class="License-contents"> Apache License
83- Version 2.0, January 2004
84- http://www.apache.org/licenses/
85- </pre>
86- </section>
87- <section class="License" id="lic-1">
88- <h2 class="go-textTitle">
89- <div id="#lic-1">BSD-2-Clause, BSD-3-Clause, HPND</div>
90- </h2>
91- <p>This is not legal advice. <a href="/license-policy">Read disclaimer.</a></p>
92- <pre class="License-contents">Copyright (c) 2013-2019 Tommi Virtanen.
93- Copyright (c) 2009, 2011, 2012 The Go Authors.
94- All rights reserved.
95- </pre>
96- </section>
97- </article>`
98- }
99- )
77+ data : httpContent
78+ } )
10079 }
10180 Fetch = proxyquire ( '../../../../providers/fetch/goFetch' , {
10281 request : { get : getStub } ,
You can’t perform that action at this time.
0 commit comments