hammer_cli_foreman 2.1.1 → 2.3.1

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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +31 -1
  3. data/doc/testing.md +13 -0
  4. data/lib/hammer_cli_foreman.rb +1 -5
  5. data/lib/hammer_cli_foreman/associating_commands.rb +4 -5
  6. data/lib/hammer_cli_foreman/audit.rb +7 -0
  7. data/lib/hammer_cli_foreman/auth.rb +4 -4
  8. data/lib/hammer_cli_foreman/command_extensions/ping.rb +10 -1
  9. data/lib/hammer_cli_foreman/commands.rb +3 -1
  10. data/lib/hammer_cli_foreman/compute_resource/ovirt.rb +1 -0
  11. data/lib/hammer_cli_foreman/host.rb +3 -2
  12. data/lib/hammer_cli_foreman/hosts/common_update_options.rb +16 -9
  13. data/lib/hammer_cli_foreman/id_resolver.rb +2 -2
  14. data/lib/hammer_cli_foreman/location.rb +2 -0
  15. data/lib/hammer_cli_foreman/option_builders.rb +1 -1
  16. data/lib/hammer_cli_foreman/organization.rb +2 -0
  17. data/lib/hammer_cli_foreman/output/fields.rb +1 -1
  18. data/lib/hammer_cli_foreman/output/formatters.rb +1 -1
  19. data/lib/hammer_cli_foreman/ping.rb +20 -11
  20. data/lib/hammer_cli_foreman/references.rb +16 -0
  21. data/lib/hammer_cli_foreman/settings.rb +14 -0
  22. data/lib/hammer_cli_foreman/testing/api_expectations.rb +10 -0
  23. data/lib/hammer_cli_foreman/version.rb +1 -1
  24. data/lib/minitest/coverage_reporter.rb +94 -0
  25. data/lib/minitest/hammer_coverage_plugin.rb +19 -0
  26. data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  27. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  28. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  29. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  30. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  31. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  32. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  33. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  34. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  35. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  36. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  37. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  38. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  39. data/test/functional/audit_test.rb +86 -63
  40. data/test/functional/commands/list_test.rb +11 -11
  41. data/test/functional/compute_profile_test.rb +4 -2
  42. data/test/functional/host_test.rb +43 -18
  43. data/test/functional/location_test.rb +134 -0
  44. data/test/functional/media_test.rb +130 -0
  45. data/test/functional/organization_test.rb +52 -0
  46. data/test/functional/realm_test.rb +103 -0
  47. data/test/functional/role_test.rb +9 -12
  48. data/test/functional/settings_test.rb +57 -1
  49. data/test/functional/user_test.rb +39 -0
  50. data/test/reports/TEST-Minitest-Result.xml +4344 -0
  51. data/test/test_helper.rb +5 -2
  52. data/test/unit/api/interactive_basic_auth_test.rb +3 -1
  53. data/test/unit/api/oauth/oauth_authentication_code_grant_test.rb +2 -2
  54. data/test/unit/api/oauth/oauth_password_grant_test.rb +2 -2
  55. data/test/unit/api_test.rb +3 -4
  56. data/test/unit/apipie_resource_mock.rb +4 -4
  57. data/test/unit/audit_test.rb +1 -0
  58. data/test/unit/commands_test.rb +19 -19
  59. data/test/unit/common_parameter_test.rb +1 -1
  60. data/test/unit/dependency_resolver_test.rb +4 -4
  61. data/test/unit/exception_handler_test.rb +13 -13
  62. data/test/unit/helpers/command.rb +5 -5
  63. data/test/unit/helpers/resource_disabled.rb +2 -2
  64. data/test/unit/host_test.rb +1 -24
  65. data/test/unit/id_resolver_test.rb +23 -23
  66. data/test/unit/media_test.rb +1 -1
  67. data/test/unit/option_builders_test.rb +49 -49
  68. data/test/unit/option_sources/id_params_test.rb +2 -2
  69. data/test/unit/option_sources/ids_params_test.rb +2 -2
  70. data/test/unit/output/formatters_test.rb +21 -21
  71. data/test/unit/param_filters_test.rb +17 -17
  72. data/test/unit/partition_table_test.rb +2 -2
  73. data/test/unit/role_test.rb +2 -2
  74. data/test/unit/sessions_test.rb +24 -24
  75. data/test/unit/template_test.rb +1 -1
  76. metadata +108 -103
  77. data/lib/hammer_cli_foreman/trend.rb +0 -47
  78. data/test/functional/trend_test.rb +0 -22
@@ -45,7 +45,7 @@ describe HammerCLIForeman::Template do
45
45
  }
46
46
  }
47
47
  ResourceMocks.mock_action_call(:provisioning_templates, :show, template_wo_kind)
48
- cmd.run([]).must_equal 0
48
+ _(cmd.run([])).must_equal 0
49
49
  end
50
50
  end
51
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomáš Strachota
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-29 00:00:00.000000000 Z
12
+ date: 2021-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hammer_cli
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 2.1.0
20
+ version: 2.3.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 2.1.0
27
+ version: 2.3.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: apipie-bindings
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -75,20 +75,20 @@ dependencies:
75
75
  version: 2.2.1
76
76
  description: 'Foreman commands for Hammer CLI
77
77
 
78
- '
78
+ '
79
79
  email: tstracho@redhat.com
80
80
  executables: []
81
81
  extensions: []
82
82
  extra_rdoc_files:
83
- - doc/configuration.md
84
- - doc/developer_docs.md
85
83
  - doc/host_create.md
86
- - doc/name_id_resolution.md
87
- - doc/option_builder.md
84
+ - doc/release_notes.md
88
85
  - doc/plugin.md
86
+ - doc/configuration.md
87
+ - doc/name_id_resolution.md
88
+ - doc/developer_docs.md
89
89
  - doc/using_hammer_cli_foreman_command.md
90
90
  - doc/testing.md
91
- - doc/release_notes.md
91
+ - doc/option_builder.md
92
92
  - README.md
93
93
  files:
94
94
  - LICENSE
@@ -211,12 +211,13 @@ files:
211
211
  - lib/hammer_cli_foreman/task_helper.rb
212
212
  - lib/hammer_cli_foreman/template.rb
213
213
  - lib/hammer_cli_foreman/testing/api_expectations.rb
214
- - lib/hammer_cli_foreman/trend.rb
215
214
  - lib/hammer_cli_foreman/user.rb
216
215
  - lib/hammer_cli_foreman/user_mail_notification.rb
217
216
  - lib/hammer_cli_foreman/usergroup.rb
218
217
  - lib/hammer_cli_foreman/version.rb
219
218
  - lib/hammer_cli_foreman/virtual_machine.rb
219
+ - lib/minitest/coverage_reporter.rb
220
+ - lib/minitest/hammer_coverage_plugin.rb
220
221
  - locale/ca/LC_MESSAGES/hammer-cli-foreman.mo
221
222
  - locale/de/LC_MESSAGES/hammer-cli-foreman.mo
222
223
  - locale/en/LC_MESSAGES/hammer-cli-foreman.mo
@@ -260,10 +261,12 @@ files:
260
261
  - test/functional/http_proxy_test.rb
261
262
  - test/functional/location_test.rb
262
263
  - test/functional/mail_notification_test.rb
264
+ - test/functional/media_test.rb
263
265
  - test/functional/organization_test.rb
264
266
  - test/functional/personal_access_token_test.rb
265
267
  - test/functional/ping_test.rb
266
268
  - test/functional/proxy_test.rb
269
+ - test/functional/realm_test.rb
267
270
  - test/functional/report_template_test.rb
268
271
  - test/functional/role_test.rb
269
272
  - test/functional/settings_test.rb
@@ -274,10 +277,10 @@ files:
274
277
  - test/functional/subnet/update_test.rb
275
278
  - test/functional/template_test.rb
276
279
  - test/functional/test_helper.rb
277
- - test/functional/trend_test.rb
278
280
  - test/functional/user_mail_notification_test.rb
279
281
  - test/functional/user_test.rb
280
282
  - test/functional/virtual_machine_test.rb
283
+ - test/reports/TEST-Minitest-Result.xml
281
284
  - test/test_helper.rb
282
285
  - test/unit/api/interactive_basic_auth_test.rb
283
286
  - test/unit/api/oauth/oauth_authentication_code_grant_test.rb
@@ -355,114 +358,116 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
358
  - !ruby/object:Gem::Version
356
359
  version: '0'
357
360
  requirements: []
358
- rubygems_version: 3.1.2
361
+ rubygems_version: 3.0.8
359
362
  signing_key:
360
363
  specification_version: 4
361
364
  summary: Foreman commands for Hammer
362
365
  test_files:
363
- - test/data/1.10/foreman_api.json
366
+ - test/unit/image_test.rb
367
+ - test/unit/helpers/resource_disabled.rb
368
+ - test/unit/helpers/fake_searchables.rb
369
+ - test/unit/helpers/command.rb
370
+ - test/unit/messages_test.rb
371
+ - test/unit/config_group_test.rb
372
+ - test/unit/option_sources/id_params_test.rb
373
+ - test/unit/option_sources/ids_params_test.rb
374
+ - test/unit/exception_handler_test.rb
375
+ - test/unit/user_test.rb
376
+ - test/unit/api/session_authenticator_wrapper_test.rb
377
+ - test/unit/api/interactive_basic_auth_test.rb
378
+ - test/unit/api/oauth/oauth_authentication_code_grant_test.rb
379
+ - test/unit/api/oauth/oauth_password_grant_test.rb
380
+ - test/unit/api/void_auth_test.rb
381
+ - test/unit/hostgroup_test.rb
382
+ - test/unit/realm_test.rb
383
+ - test/unit/auth_source_external.rb
384
+ - test/unit/data/test_api.json
385
+ - test/unit/auth_source_ldap_test.rb
386
+ - test/unit/audit_test.rb
387
+ - test/unit/test_helper.rb
388
+ - test/unit/smart_class_parameter_test.rb
389
+ - test/unit/partition_table_test.rb
390
+ - test/unit/operating_system_test.rb
391
+ - test/unit/media_test.rb
392
+ - test/unit/architecture_test.rb
393
+ - test/unit/usergroup_test.rb
394
+ - test/unit/role_test.rb
395
+ - test/unit/location_test.rb
396
+ - test/unit/param_filters_test.rb
397
+ - test/unit/apipie_resource_mock.rb
398
+ - test/unit/option_builders_test.rb
399
+ - test/unit/api_test.rb
400
+ - test/unit/test_output_adapter.rb
401
+ - test/unit/sessions_test.rb
402
+ - test/unit/organization_test.rb
403
+ - test/unit/settings_test.rb
404
+ - test/unit/template_test.rb
405
+ - test/unit/dependency_resolver_test.rb
406
+ - test/unit/smart_proxy_test.rb
407
+ - test/unit/domain_test.rb
408
+ - test/unit/defaults_test.rb
409
+ - test/unit/model_test.rb
410
+ - test/unit/puppet_class_test.rb
411
+ - test/unit/compute_resource_test.rb
412
+ - test/unit/id_resolver_test.rb
413
+ - test/unit/filter_test.rb
414
+ - test/unit/puppet_environment_test.rb
415
+ - test/unit/output/formatters_test.rb
416
+ - test/unit/host_test.rb
417
+ - test/unit/config_report_test.rb
418
+ - test/unit/fact_test.rb
419
+ - test/unit/external_usergroup_test.rb
420
+ - test/unit/commands_test.rb
421
+ - test/unit/common_parameter_test.rb
422
+ - test/unit/subnet_test.rb
423
+ - test/data/2.1/foreman_api.json
424
+ - test/data/2.0/foreman_api.json
425
+ - test/data/1.24/foreman_api.json
426
+ - test/data/1.18/foreman_api.json
364
427
  - test/data/1.11/foreman_api.json
428
+ - test/data/1.10/foreman_api.json
429
+ - test/data/1.17/foreman_api.json
430
+ - test/data/1.15/foreman_api.json
365
431
  - test/data/1.14/_foreman_api.json
366
432
  - test/data/1.14/foreman_api.json
367
- - test/data/1.15/foreman_api.json
368
- - test/data/1.16/foreman_api.json
369
- - test/data/1.17/foreman_api.json
370
- - test/data/1.18/foreman_api.json
371
- - test/data/1.20/foreman_api.json
372
433
  - test/data/1.21/foreman_api.json
373
434
  - test/data/1.22/foreman_api.json
374
- - test/data/1.24/foreman_api.json
375
- - test/data/2.0/foreman_api.json
376
- - test/data/2.1/foreman_api.json
435
+ - test/data/1.20/foreman_api.json
377
436
  - test/data/README.md
378
- - test/functional/associating_commands_test.rb
379
- - test/functional/audit_test.rb
380
- - test/functional/auth_source_test.rb
381
- - test/functional/bookmark_test.rb
437
+ - test/data/1.16/foreman_api.json
438
+ - test/functional/http_proxy_test.rb
382
439
  - test/functional/commands/list_test.rb
383
- - test/functional/compute_attribute_test.rb
384
- - test/functional/compute_profile_test.rb
385
- - test/functional/compute_resource_test.rb
386
- - test/functional/filter_test.rb
387
- - test/functional/host_test.rb
440
+ - test/functional/user_mail_notification_test.rb
441
+ - test/functional/user_test.rb
442
+ - test/functional/realm_test.rb
443
+ - test/functional/personal_access_token_test.rb
444
+ - test/functional/audit_test.rb
445
+ - test/functional/test_helper.rb
446
+ - test/functional/mail_notification_test.rb
447
+ - test/functional/ping_test.rb
448
+ - test/functional/smart_class_parameter_test.rb
449
+ - test/functional/media_test.rb
450
+ - test/functional/role_test.rb
451
+ - test/functional/location_test.rb
388
452
  - test/functional/hostgroup/create_test.rb
389
453
  - test/functional/hostgroup/update_test.rb
390
- - test/functional/location_test.rb
391
- - test/functional/mail_notification_test.rb
454
+ - test/functional/subnet/create_test.rb
455
+ - test/functional/subnet/update_test.rb
392
456
  - test/functional/organization_test.rb
393
- - test/functional/personal_access_token_test.rb
394
- - test/functional/ping_test.rb
457
+ - test/functional/settings_test.rb
458
+ - test/functional/template_test.rb
395
459
  - test/functional/proxy_test.rb
460
+ - test/functional/compute_resource_test.rb
461
+ - test/functional/compute_attribute_test.rb
462
+ - test/functional/filter_test.rb
396
463
  - test/functional/report_template_test.rb
397
- - test/functional/role_test.rb
398
- - test/functional/settings_test.rb
399
- - test/functional/smart_class_parameter_test.rb
464
+ - test/functional/compute_profile_test.rb
465
+ - test/functional/host_test.rb
400
466
  - test/functional/ssh_keys_test.rb
401
467
  - test/functional/status_test.rb
402
- - test/functional/subnet/create_test.rb
403
- - test/functional/subnet/update_test.rb
404
- - test/functional/template_test.rb
405
- - test/functional/test_helper.rb
406
- - test/functional/trend_test.rb
407
- - test/functional/user_test.rb
468
+ - test/functional/associating_commands_test.rb
469
+ - test/functional/auth_source_test.rb
408
470
  - test/functional/virtual_machine_test.rb
409
- - test/functional/user_mail_notification_test.rb
410
- - test/functional/http_proxy_test.rb
471
+ - test/functional/bookmark_test.rb
411
472
  - test/test_helper.rb
412
- - test/unit/api/interactive_basic_auth_test.rb
413
- - test/unit/api/oauth/oauth_authentication_code_grant_test.rb
414
- - test/unit/api/oauth/oauth_password_grant_test.rb
415
- - test/unit/api/session_authenticator_wrapper_test.rb
416
- - test/unit/api/void_auth_test.rb
417
- - test/unit/api_test.rb
418
- - test/unit/apipie_resource_mock.rb
419
- - test/unit/architecture_test.rb
420
- - test/unit/audit_test.rb
421
- - test/unit/auth_source_external.rb
422
- - test/unit/auth_source_ldap_test.rb
423
- - test/unit/commands_test.rb
424
- - test/unit/common_parameter_test.rb
425
- - test/unit/compute_resource_test.rb
426
- - test/unit/config_group_test.rb
427
- - test/unit/config_report_test.rb
428
- - test/unit/data/test_api.json
429
- - test/unit/defaults_test.rb
430
- - test/unit/dependency_resolver_test.rb
431
- - test/unit/domain_test.rb
432
- - test/unit/exception_handler_test.rb
433
- - test/unit/external_usergroup_test.rb
434
- - test/unit/fact_test.rb
435
- - test/unit/filter_test.rb
436
- - test/unit/helpers/command.rb
437
- - test/unit/helpers/fake_searchables.rb
438
- - test/unit/helpers/resource_disabled.rb
439
- - test/unit/host_test.rb
440
- - test/unit/hostgroup_test.rb
441
- - test/unit/id_resolver_test.rb
442
- - test/unit/image_test.rb
443
- - test/unit/location_test.rb
444
- - test/unit/media_test.rb
445
- - test/unit/messages_test.rb
446
- - test/unit/model_test.rb
447
- - test/unit/operating_system_test.rb
448
- - test/unit/option_builders_test.rb
449
- - test/unit/option_sources/id_params_test.rb
450
- - test/unit/option_sources/ids_params_test.rb
451
- - test/unit/organization_test.rb
452
- - test/unit/output/formatters_test.rb
453
- - test/unit/param_filters_test.rb
454
- - test/unit/partition_table_test.rb
455
- - test/unit/puppet_class_test.rb
456
- - test/unit/puppet_environment_test.rb
457
- - test/unit/realm_test.rb
458
- - test/unit/role_test.rb
459
- - test/unit/settings_test.rb
460
- - test/unit/smart_class_parameter_test.rb
461
- - test/unit/smart_proxy_test.rb
462
- - test/unit/subnet_test.rb
463
- - test/unit/template_test.rb
464
- - test/unit/test_helper.rb
465
- - test/unit/test_output_adapter.rb
466
- - test/unit/user_test.rb
467
- - test/unit/usergroup_test.rb
468
- - test/unit/sessions_test.rb
473
+ - test/reports/TEST-Minitest-Result.xml
@@ -1,47 +0,0 @@
1
- module HammerCLIForeman
2
-
3
- class Trend < HammerCLIForeman::Command
4
-
5
- resource :trends
6
-
7
- class ListCommand < HammerCLIForeman::ListCommand
8
- output do
9
- field :id, _("Id")
10
- field :name, _("Name")
11
- field :label, _("Label")
12
- end
13
-
14
- build_options
15
- end
16
-
17
- class CreateCommand < HammerCLIForeman::CreateCommand
18
- success_message _("Trend for %<trendable_type>s created.")
19
- failure_message _("Could not create the trend")
20
-
21
- build_options
22
- end
23
-
24
- class DeleteCommand < HammerCLIForeman::DeleteCommand
25
- success_message _("Trend for %<trendable_type>s deleted.")
26
- failure_message _("Could not delete the trend")
27
-
28
- build_options
29
- end
30
-
31
- class InfoCommand < HammerCLIForeman::InfoCommand
32
- output do
33
- field :id, _('Id')
34
- field :name, _('Name')
35
- field :label, _("Label")
36
- field :trendable_type, _('Type')
37
- HammerCLIForeman::References.taxonomies(self)
38
- HammerCLIForeman::References.timestamps(self)
39
- end
40
-
41
- build_options
42
- end
43
-
44
- autoload_subcommands
45
- end
46
- end
47
-
@@ -1,22 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
2
-
3
- describe 'trend' do
4
- describe 'list' do
5
- before do
6
- @cmd = %w(trend list)
7
- @trends =
8
- [{
9
- id: 1,
10
- label: "Operatingsystem",
11
- trendable_type: "Operatingsystem",
12
- name: "os_trend" }]
13
- end
14
-
15
- it 'should return a list of trends' do
16
- api_expects(:trends, :index, 'List trends').returns(@trends)
17
-
18
- result = run_cmd(@cmd)
19
- result.exit_code.must_equal HammerCLI::EX_OK
20
- end
21
- end
22
- end