virustotal_api 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require './test/test_helper'
4
+
5
+ class VirustotalAPIGroupReportTest < Minitest::Test
6
+ def setup
7
+ @group_id = 'GROUP_us'
8
+ @api_key = 'testapikey'
9
+ end
10
+
11
+ def test_class_exists
12
+ assert VirustotalAPI::Group
13
+ end
14
+
15
+ def test_report_response
16
+ VCR.use_cassette('group_find') do
17
+ vtgroup_report = VirustotalAPI::Group.find(@group_id, @api_key)
18
+
19
+ # Make sure that the JSON was parsed
20
+ assert vtgroup_report.is_a?(VirustotalAPI::Group)
21
+ assert vtgroup_report.report.is_a?(Hash)
22
+ end
23
+ end
24
+
25
+ def test_find
26
+ VCR.use_cassette('group_find') do
27
+ vtgroup_report = VirustotalAPI::Group.find(@group_id, @api_key)
28
+
29
+ assert vtgroup_report.report_url.is_a?(String)
30
+ end
31
+ end
32
+ end
@@ -43,7 +43,7 @@ class VirustotalAPIURLReportTest < Minitest::Test
43
43
  VCR.use_cassette('unscanned_url_find') do
44
44
  vturl_report = VirustotalAPI::URL.find(@unscanned_url, @api_key)
45
45
 
46
- assert_nil vturl_report.report
46
+ assert_empty vturl_report.report
47
47
  end
48
48
  end
49
49
 
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require './test/test_helper'
4
+
5
+ class VirustotalAPIUserReportTest < Minitest::Test
6
+ def setup
7
+ @api_key = 'testapikey'
8
+ end
9
+
10
+ def test_class_exists
11
+ assert VirustotalAPI::User
12
+ end
13
+
14
+ def test_report_response
15
+ VCR.use_cassette('user_find') do
16
+ vtuser_report = VirustotalAPI::User.find(@api_key, @api_key)
17
+
18
+ # Make sure that the JSON was parsed
19
+ assert vtuser_report.is_a?(VirustotalAPI::User)
20
+ assert vtuser_report.report.is_a?(Hash)
21
+ end
22
+ end
23
+
24
+ def test_find
25
+ VCR.use_cassette('user_find') do
26
+ vtuser_report = VirustotalAPI::User.find(@api_key, @api_key)
27
+
28
+ assert vtuser_report.report_url.is_a?(String)
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: virustotal_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pwelch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-06 00:00:00.000000000 Z
11
+ date: 2020-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -198,9 +198,11 @@ files:
198
198
  - lib/virustotal_api/domain.rb
199
199
  - lib/virustotal_api/exceptions.rb
200
200
  - lib/virustotal_api/file.rb
201
+ - lib/virustotal_api/group.rb
201
202
  - lib/virustotal_api/ip.rb
202
203
  - lib/virustotal_api/uri.rb
203
204
  - lib/virustotal_api/url.rb
205
+ - lib/virustotal_api/user.rb
204
206
  - lib/virustotal_api/version.rb
205
207
  - test/analysis_test.rb
206
208
  - test/base_test.rb
@@ -211,17 +213,23 @@ files:
211
213
  - test/fixtures/domain.yml
212
214
  - test/fixtures/file_analyse.yml
213
215
  - test/fixtures/file_find.yml
216
+ - test/fixtures/file_not_found.yml
217
+ - test/fixtures/file_rate_limit.yml
214
218
  - test/fixtures/file_unauthorized.yml
215
219
  - test/fixtures/file_upload.yml
220
+ - test/fixtures/group_find.yml
216
221
  - test/fixtures/ip.yml
217
222
  - test/fixtures/null_file
218
223
  - test/fixtures/unscanned_url_find.yml
219
224
  - test/fixtures/url_analyse.yml
220
225
  - test/fixtures/url_find.yml
226
+ - test/fixtures/user_find.yml
227
+ - test/group_test.rb
221
228
  - test/ip_test.rb
222
229
  - test/test_helper.rb
223
230
  - test/uri_test.rb
224
231
  - test/url_test.rb
232
+ - test/user_test.rb
225
233
  - test/version_test.rb
226
234
  - virustotal_api.gemspec
227
235
  homepage: https://github.com/pwelch/virustotal_api
@@ -257,15 +265,21 @@ test_files:
257
265
  - test/fixtures/domain.yml
258
266
  - test/fixtures/file_analyse.yml
259
267
  - test/fixtures/file_find.yml
268
+ - test/fixtures/file_not_found.yml
269
+ - test/fixtures/file_rate_limit.yml
260
270
  - test/fixtures/file_unauthorized.yml
261
271
  - test/fixtures/file_upload.yml
272
+ - test/fixtures/group_find.yml
262
273
  - test/fixtures/ip.yml
263
274
  - test/fixtures/null_file
264
275
  - test/fixtures/unscanned_url_find.yml
265
276
  - test/fixtures/url_analyse.yml
266
277
  - test/fixtures/url_find.yml
278
+ - test/fixtures/user_find.yml
279
+ - test/group_test.rb
267
280
  - test/ip_test.rb
268
281
  - test/test_helper.rb
269
282
  - test/uri_test.rb
270
283
  - test/url_test.rb
284
+ - test/user_test.rb
271
285
  - test/version_test.rb