automation-test 1.1 → 1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -12
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/api_helper.rb +2 -2
- data/lib/coin_gecko_apiv3/client.rb +125 -0
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/configuration.rb +5 -6
- data/lib/coin_gecko_apiv3/controllers/asset_platforms_controller.rb +29 -0
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/controllers/base_controller.rb +2 -2
- data/lib/coin_gecko_apiv3/controllers/categories_controller.rb +52 -0
- data/lib/coin_gecko_apiv3/controllers/coins_controller.rb +389 -0
- data/lib/coin_gecko_apiv3/controllers/companies_beta_controller.rb +35 -0
- data/lib/coin_gecko_apiv3/controllers/contract_controller.rb +119 -0
- data/lib/coin_gecko_apiv3/controllers/derivatives_controller.rb +112 -0
- data/lib/coin_gecko_apiv3/controllers/events_controller.rb +89 -0
- data/lib/coin_gecko_apiv3/controllers/exchange_rates_controller.rb +29 -0
- data/lib/coin_gecko_apiv3/controllers/exchanges_controller.rb +192 -0
- data/lib/coin_gecko_apiv3/controllers/finance_controller.rb +71 -0
- data/lib/coin_gecko_apiv3/controllers/global_controller.rb +29 -0
- data/lib/coin_gecko_apiv3/controllers/indexes_controller.rb +79 -0
- data/lib/coin_gecko_apiv3/controllers/ping_controller.rb +29 -0
- data/lib/coin_gecko_apiv3/controllers/simple_controller.rb +126 -0
- data/lib/coin_gecko_apiv3/controllers/status_updates_controller.rb +48 -0
- data/lib/coin_gecko_apiv3/controllers/trending_controller.rb +30 -0
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/exceptions/api_exception.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/faraday_client.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_call_back.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_client.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_method_enum.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_request.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_response.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/models/base_model.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/utilities/date_time_helper.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/utilities/file_wrapper.rb +2 -2
- data/lib/coin_gecko_apiv3.rb +52 -0
- data/test/controllers/controller_test_base.rb +3 -3
- data/test/controllers/test_asset_platforms_controller.rb +25 -0
- data/test/controllers/test_categories_controller.rb +37 -0
- data/test/controllers/test_coins_controller.rb +27 -0
- data/test/controllers/test_derivatives_controller.rb +51 -0
- data/test/controllers/test_events_controller.rb +55 -0
- data/test/controllers/test_exchange_rates_controller.rb +26 -0
- data/test/controllers/test_exchanges_controller.rb +38 -0
- data/test/controllers/test_finance_controller.rb +43 -0
- data/test/controllers/test_global_controller.rb +26 -0
- data/test/controllers/test_indexes_controller.rb +38 -0
- data/test/controllers/test_ping_controller.rb +26 -0
- data/test/controllers/test_simple_controller.rb +25 -0
- data/test/controllers/test_status_updates_controller.rb +31 -0
- data/test/controllers/test_trending_controller.rb +25 -0
- data/test/http_response_catcher.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +49 -22
- data/lib/apimatic_calculator/client.rb +0 -35
- data/lib/apimatic_calculator/controllers/simple_calculator_controller.rb +0 -45
- data/lib/apimatic_calculator/models/operation_type_enum.rb +0 -23
- data/lib/apimatic_calculator.rb +0 -38
- data/test/controllers/test_simple_calculator_controller.rb +0 -34
@@ -0,0 +1,26 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require_relative 'controller_test_base'
|
7
|
+
|
8
|
+
class PingControllerTests < ControllerTestBase
|
9
|
+
# Called only once for the class before any test has executed
|
10
|
+
def setup
|
11
|
+
@response_catcher = HttpResponseCatcher.new
|
12
|
+
@controller = PingController.new CONFIG, http_call_back: @response_catcher
|
13
|
+
end
|
14
|
+
|
15
|
+
# Check API server status
|
16
|
+
#
|
17
|
+
def test_check_ap_iserverstatus()
|
18
|
+
|
19
|
+
# Perform the API call through the SDK function
|
20
|
+
@controller.check_ap_iserverstatus()
|
21
|
+
|
22
|
+
# Test response code
|
23
|
+
assert_equal(200, @response_catcher.response.status_code)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require_relative 'controller_test_base'
|
7
|
+
|
8
|
+
class SimpleControllerTests < ControllerTestBase
|
9
|
+
# Called only once for the class before any test has executed
|
10
|
+
def setup
|
11
|
+
@response_catcher = HttpResponseCatcher.new
|
12
|
+
@controller = SimpleController.new CONFIG, http_call_back: @response_catcher
|
13
|
+
end
|
14
|
+
|
15
|
+
# Get list of supported_vs_currencies.
|
16
|
+
def test_getlistofsupported_vs_currencies()
|
17
|
+
|
18
|
+
# Perform the API call through the SDK function
|
19
|
+
@controller.getlistofsupported_vs_currencies()
|
20
|
+
|
21
|
+
# Test response code
|
22
|
+
assert_equal(200, @response_catcher.response.status_code)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require_relative 'controller_test_base'
|
7
|
+
|
8
|
+
class StatusUpdatesControllerTests < ControllerTestBase
|
9
|
+
# Called only once for the class before any test has executed
|
10
|
+
def setup
|
11
|
+
@response_catcher = HttpResponseCatcher.new
|
12
|
+
@controller = StatusUpdatesController.new CONFIG, http_call_back: @response_catcher
|
13
|
+
end
|
14
|
+
|
15
|
+
# List all status_updates with data (description, category, created_at, user, user_title and pin)
|
16
|
+
#
|
17
|
+
def test_listallstatus_updateswithdata_description_category_created_at_user_user_titleandpin()
|
18
|
+
# Parameters for the API call
|
19
|
+
category = nil
|
20
|
+
project_type = nil
|
21
|
+
per_page = nil
|
22
|
+
page = nil
|
23
|
+
|
24
|
+
# Perform the API call through the SDK function
|
25
|
+
@controller.listallstatus_updateswithdata_description_category_created_at_user_user_titleandpin(category: category, project_type: project_type, per_page: per_page, page: page)
|
26
|
+
|
27
|
+
# Test response code
|
28
|
+
assert_equal(200, @response_catcher.response.status_code)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require_relative 'controller_test_base'
|
7
|
+
|
8
|
+
class TrendingControllerTests < ControllerTestBase
|
9
|
+
# Called only once for the class before any test has executed
|
10
|
+
def setup
|
11
|
+
@response_catcher = HttpResponseCatcher.new
|
12
|
+
@controller = TrendingController.new CONFIG, http_call_back: @response_catcher
|
13
|
+
end
|
14
|
+
|
15
|
+
# Top-7 trending coins on CoinGecko as searched by users in the last 24 hours (Ordered by most popular first)
|
16
|
+
def test_gettrendingsearchcoins_top_7_on_coin_geckointhelast24hours()
|
17
|
+
|
18
|
+
# Perform the API call through the SDK function
|
19
|
+
@controller.gettrendingsearchcoins_top_7_on_coin_geckointhelast24hours()
|
20
|
+
|
21
|
+
# Test response code
|
22
|
+
assert_equal(200, @response_catcher.response.status_code)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# coin_gecko_apiv3
|
2
2
|
#
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
-
class HttpResponseCatcher <
|
6
|
+
class HttpResponseCatcher < CoinGeckoApiv3::HttpCallBack
|
7
7
|
attr_accessor :response
|
8
8
|
|
9
9
|
def on_before_request(request)
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: automation-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- APIMatic SDK Generator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -126,7 +126,7 @@ dependencies:
|
|
126
126
|
- - "~>"
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '1.0'
|
129
|
-
description:
|
129
|
+
description: ''
|
130
130
|
email: support@apimatic.io
|
131
131
|
executables: []
|
132
132
|
extensions: []
|
@@ -134,25 +134,52 @@ extra_rdoc_files: []
|
|
134
134
|
files:
|
135
135
|
- LICENSE
|
136
136
|
- README.md
|
137
|
-
- lib/
|
138
|
-
- lib/
|
139
|
-
- lib/
|
140
|
-
- lib/
|
141
|
-
- lib/
|
142
|
-
- lib/
|
143
|
-
- lib/
|
144
|
-
- lib/
|
145
|
-
- lib/
|
146
|
-
- lib/
|
147
|
-
- lib/
|
148
|
-
- lib/
|
149
|
-
- lib/
|
150
|
-
- lib/
|
151
|
-
- lib/
|
152
|
-
- lib/
|
153
|
-
- lib/
|
137
|
+
- lib/coin_gecko_apiv3.rb
|
138
|
+
- lib/coin_gecko_apiv3/api_helper.rb
|
139
|
+
- lib/coin_gecko_apiv3/client.rb
|
140
|
+
- lib/coin_gecko_apiv3/configuration.rb
|
141
|
+
- lib/coin_gecko_apiv3/controllers/asset_platforms_controller.rb
|
142
|
+
- lib/coin_gecko_apiv3/controllers/base_controller.rb
|
143
|
+
- lib/coin_gecko_apiv3/controllers/categories_controller.rb
|
144
|
+
- lib/coin_gecko_apiv3/controllers/coins_controller.rb
|
145
|
+
- lib/coin_gecko_apiv3/controllers/companies_beta_controller.rb
|
146
|
+
- lib/coin_gecko_apiv3/controllers/contract_controller.rb
|
147
|
+
- lib/coin_gecko_apiv3/controllers/derivatives_controller.rb
|
148
|
+
- lib/coin_gecko_apiv3/controllers/events_controller.rb
|
149
|
+
- lib/coin_gecko_apiv3/controllers/exchange_rates_controller.rb
|
150
|
+
- lib/coin_gecko_apiv3/controllers/exchanges_controller.rb
|
151
|
+
- lib/coin_gecko_apiv3/controllers/finance_controller.rb
|
152
|
+
- lib/coin_gecko_apiv3/controllers/global_controller.rb
|
153
|
+
- lib/coin_gecko_apiv3/controllers/indexes_controller.rb
|
154
|
+
- lib/coin_gecko_apiv3/controllers/ping_controller.rb
|
155
|
+
- lib/coin_gecko_apiv3/controllers/simple_controller.rb
|
156
|
+
- lib/coin_gecko_apiv3/controllers/status_updates_controller.rb
|
157
|
+
- lib/coin_gecko_apiv3/controllers/trending_controller.rb
|
158
|
+
- lib/coin_gecko_apiv3/exceptions/api_exception.rb
|
159
|
+
- lib/coin_gecko_apiv3/http/faraday_client.rb
|
160
|
+
- lib/coin_gecko_apiv3/http/http_call_back.rb
|
161
|
+
- lib/coin_gecko_apiv3/http/http_client.rb
|
162
|
+
- lib/coin_gecko_apiv3/http/http_method_enum.rb
|
163
|
+
- lib/coin_gecko_apiv3/http/http_request.rb
|
164
|
+
- lib/coin_gecko_apiv3/http/http_response.rb
|
165
|
+
- lib/coin_gecko_apiv3/models/base_model.rb
|
166
|
+
- lib/coin_gecko_apiv3/utilities/date_time_helper.rb
|
167
|
+
- lib/coin_gecko_apiv3/utilities/file_wrapper.rb
|
154
168
|
- test/controllers/controller_test_base.rb
|
155
|
-
- test/controllers/
|
169
|
+
- test/controllers/test_asset_platforms_controller.rb
|
170
|
+
- test/controllers/test_categories_controller.rb
|
171
|
+
- test/controllers/test_coins_controller.rb
|
172
|
+
- test/controllers/test_derivatives_controller.rb
|
173
|
+
- test/controllers/test_events_controller.rb
|
174
|
+
- test/controllers/test_exchange_rates_controller.rb
|
175
|
+
- test/controllers/test_exchanges_controller.rb
|
176
|
+
- test/controllers/test_finance_controller.rb
|
177
|
+
- test/controllers/test_global_controller.rb
|
178
|
+
- test/controllers/test_indexes_controller.rb
|
179
|
+
- test/controllers/test_ping_controller.rb
|
180
|
+
- test/controllers/test_simple_controller.rb
|
181
|
+
- test/controllers/test_status_updates_controller.rb
|
182
|
+
- test/controllers/test_trending_controller.rb
|
156
183
|
- test/http_response_catcher.rb
|
157
184
|
- test/test_helper.rb
|
158
185
|
homepage: https://apimatic.io
|
@@ -181,5 +208,5 @@ rubyforge_project:
|
|
181
208
|
rubygems_version: 2.7.6
|
182
209
|
signing_key:
|
183
210
|
specification_version: 4
|
184
|
-
summary:
|
211
|
+
summary: coin_gecko_apiv3
|
185
212
|
test_files: []
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# apimatic_calculator
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module ApimaticCalculator
|
7
|
-
# apimatic_calculator client class.
|
8
|
-
class Client
|
9
|
-
attr_reader :config
|
10
|
-
|
11
|
-
# Access to simple_calculator controller.
|
12
|
-
# @return [SimpleCalculatorController] Returns the controller instance.
|
13
|
-
def simple_calculator
|
14
|
-
@simple_calculator ||= SimpleCalculatorController.new config
|
15
|
-
end
|
16
|
-
|
17
|
-
def initialize(http_client_instance: nil, timeout: 60, max_retries: 0,
|
18
|
-
retry_interval: 1, backoff_factor: 2,
|
19
|
-
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
20
|
-
retry_methods: %i[get put],
|
21
|
-
environment: Environment::PRODUCTION, config: nil)
|
22
|
-
@config = if config.nil?
|
23
|
-
Configuration.new(http_client_instance: http_client_instance,
|
24
|
-
timeout: timeout, max_retries: max_retries,
|
25
|
-
retry_interval: retry_interval,
|
26
|
-
backoff_factor: backoff_factor,
|
27
|
-
retry_statuses: retry_statuses,
|
28
|
-
retry_methods: retry_methods,
|
29
|
-
environment: environment)
|
30
|
-
else
|
31
|
-
config
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# apimatic_calculator
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module ApimaticCalculator
|
7
|
-
# SimpleCalculatorController
|
8
|
-
class SimpleCalculatorController < BaseController
|
9
|
-
def initialize(config, http_call_back: nil)
|
10
|
-
super(config, http_call_back: http_call_back)
|
11
|
-
end
|
12
|
-
|
13
|
-
# Calculates the expression using the specified operation.
|
14
|
-
# @param [OperationTypeEnum] operation Required parameter: The operator to
|
15
|
-
# apply on the variables
|
16
|
-
# @param [Float] x Required parameter: The LHS value
|
17
|
-
# @param [Float] y Required parameter: The RHS value
|
18
|
-
# @return [Float] response from the API call
|
19
|
-
def get_calculate(options = {})
|
20
|
-
# Prepare query url.
|
21
|
-
_query_builder = config.get_base_uri
|
22
|
-
_query_builder << '/{operation}'
|
23
|
-
_query_builder = APIHelper.append_url_with_template_parameters(
|
24
|
-
_query_builder,
|
25
|
-
'operation' => { 'value' => options['operation'], 'encode' => true }
|
26
|
-
)
|
27
|
-
_query_builder = APIHelper.append_url_with_query_parameters(
|
28
|
-
_query_builder,
|
29
|
-
'x' => options['x'],
|
30
|
-
'y' => options['y']
|
31
|
-
)
|
32
|
-
_query_url = APIHelper.clean_url _query_builder
|
33
|
-
|
34
|
-
# Prepare and execute HttpRequest.
|
35
|
-
_request = config.http_client.get(
|
36
|
-
_query_url
|
37
|
-
)
|
38
|
-
_response = execute_request(_request)
|
39
|
-
validate_response(_response)
|
40
|
-
|
41
|
-
# Return appropriate response type.
|
42
|
-
_response.raw_body.to_f
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# apimatic_calculator
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module ApimaticCalculator
|
7
|
-
# Possible operators are sum, subtract, multiply, divide
|
8
|
-
class OperationTypeEnum
|
9
|
-
OPERATION_TYPE_ENUM = [
|
10
|
-
# Represents the sum operator
|
11
|
-
SUM = 'SUM'.freeze,
|
12
|
-
|
13
|
-
# Represents the subtract operator
|
14
|
-
SUBTRACT = 'SUBTRACT'.freeze,
|
15
|
-
|
16
|
-
# Represents the multiply operator
|
17
|
-
MULTIPLY = 'MULTIPLY'.freeze,
|
18
|
-
|
19
|
-
# Represents the divide operator
|
20
|
-
DIVIDE = 'DIVIDE'.freeze
|
21
|
-
].freeze
|
22
|
-
end
|
23
|
-
end
|
data/lib/apimatic_calculator.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# apimatic_calculator
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
require 'date'
|
7
|
-
require 'json'
|
8
|
-
require 'faraday'
|
9
|
-
require 'certifi'
|
10
|
-
require 'logging'
|
11
|
-
|
12
|
-
require_relative 'apimatic_calculator/api_helper'
|
13
|
-
require_relative 'apimatic_calculator/client'
|
14
|
-
|
15
|
-
# Utilities
|
16
|
-
require_relative 'apimatic_calculator/utilities/file_wrapper'
|
17
|
-
require_relative 'apimatic_calculator/utilities/date_time_helper'
|
18
|
-
|
19
|
-
# Http
|
20
|
-
require_relative 'apimatic_calculator/http/http_call_back'
|
21
|
-
require_relative 'apimatic_calculator/http/http_client'
|
22
|
-
require_relative 'apimatic_calculator/http/faraday_client'
|
23
|
-
require_relative 'apimatic_calculator/http/http_method_enum'
|
24
|
-
require_relative 'apimatic_calculator/http/http_request'
|
25
|
-
require_relative 'apimatic_calculator/http/http_response'
|
26
|
-
|
27
|
-
# Models
|
28
|
-
require_relative 'apimatic_calculator/models/base_model'
|
29
|
-
require_relative 'apimatic_calculator/models/operation_type_enum'
|
30
|
-
|
31
|
-
# Exceptions
|
32
|
-
require_relative 'apimatic_calculator/exceptions/api_exception'
|
33
|
-
|
34
|
-
require_relative 'apimatic_calculator/configuration'
|
35
|
-
|
36
|
-
# Controllers
|
37
|
-
require_relative 'apimatic_calculator/controllers/base_controller'
|
38
|
-
require_relative 'apimatic_calculator/controllers/simple_calculator_controller'
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# apimatic_calculator
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
require_relative 'controller_test_base'
|
7
|
-
|
8
|
-
class SimpleCalculatorControllerTests < ControllerTestBase
|
9
|
-
# Called only once for the class before any test has executed
|
10
|
-
def setup
|
11
|
-
@response_catcher = HttpResponseCatcher.new
|
12
|
-
@controller = SimpleCalculatorController.new CONFIG, http_call_back: @response_catcher
|
13
|
-
end
|
14
|
-
|
15
|
-
# Check if multiplication works
|
16
|
-
def test_multiply()
|
17
|
-
# Parameters for the API call
|
18
|
-
options = {}
|
19
|
-
options['operation'] = 'MULTIPLY'
|
20
|
-
options['x'] = 4
|
21
|
-
options['y'] = 5
|
22
|
-
|
23
|
-
# Perform the API call through the SDK function
|
24
|
-
result = @controller.get_calculate(options)
|
25
|
-
|
26
|
-
# Test response code
|
27
|
-
assert_equal(200, @response_catcher.response.status_code)
|
28
|
-
|
29
|
-
# Test whether the captured response is as we expected
|
30
|
-
refute_nil(result)
|
31
|
-
assert_equal('20', @response_catcher.response.raw_body)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|