File tree Expand file tree Collapse file tree 2 files changed +1
-30
lines changed
lib/fastlane/plugin/wpmreleasetoolkit/helper Expand file tree Collapse file tree 2 files changed +1
-30
lines changed Original file line number Diff line number Diff line change 3
3
4
4
module Fastlane
5
5
module Helper
6
- class GlotPressDownloader
6
+ class GlotpressDownloader
7
7
AUTO_RETRY_SLEEP_TIME = 20
8
8
MAX_AUTO_RETRY_ATTEMPTS = 30
9
9
Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
2
3
- describe Fastlane ::Helper ::GlotPressDownloader do
4
- describe 'downloading' do
5
- context 'when GlotPress returs a 429 code' do
6
- it 'automatically retries' do
7
- downloader = described_class . new ( true )
8
- fake_url = 'https://test.com'
9
-
10
- count = 0
11
- stub_request ( :get , fake_url ) . to_return do
12
- count += 1
13
- if count == 1
14
- { status : 429 , body : 'Too Many Requests' }
15
- else
16
- { status : 200 , body : 'OK' }
17
- end
18
- end
19
-
20
- expect ( Fastlane ::UI ) . to receive ( :message )
21
- . with ( /Received 429 for `#{ fake_url } `. Auto retrying in 20 seconds.../ )
22
-
23
- response = downloader . download ( fake_url )
24
-
25
- expect ( count ) . to eq ( 2 )
26
- expect ( response . code ) . to eq ( '200' )
27
- end
28
- end
29
- end
30
- end
31
-
32
3
describe Fastlane ::Helper ::MetadataDownloader do
33
4
describe 'downloading from GlotPress' do
34
5
context 'when GlotPress returs a 429 code' do
You can’t perform that action at this time.
0 commit comments