hammer_cli_foreman 2.5.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +10 -4
  3. data/lib/hammer_cli_foreman/architecture.rb +5 -5
  4. data/lib/hammer_cli_foreman/associating_commands.rb +0 -24
  5. data/lib/hammer_cli_foreman/bookmark.rb +5 -5
  6. data/lib/hammer_cli_foreman/combination.rb +3 -13
  7. data/lib/hammer_cli_foreman/command_extensions.rb +0 -2
  8. data/lib/hammer_cli_foreman/commands.rb +2 -9
  9. data/lib/hammer_cli_foreman/compute_profile.rb +5 -5
  10. data/lib/hammer_cli_foreman/host.rb +0 -35
  11. data/lib/hammer_cli_foreman/hostgroup.rb +2 -53
  12. data/lib/hammer_cli_foreman/hosts/common_update_options.rb +1 -23
  13. data/lib/hammer_cli_foreman/id_resolver.rb +0 -61
  14. data/lib/hammer_cli_foreman/location.rb +0 -6
  15. data/lib/hammer_cli_foreman/mail_notification.rb +2 -2
  16. data/lib/hammer_cli_foreman/model.rb +5 -5
  17. data/lib/hammer_cli_foreman/operating_system.rb +10 -10
  18. data/lib/hammer_cli_foreman/option_sources/id_params.rb +27 -10
  19. data/lib/hammer_cli_foreman/option_sources/ids_params.rb +25 -6
  20. data/lib/hammer_cli_foreman/option_sources.rb +0 -1
  21. data/lib/hammer_cli_foreman/organization.rb +0 -6
  22. data/lib/hammer_cli_foreman/references.rb +0 -16
  23. data/lib/hammer_cli_foreman/settings.rb +3 -3
  24. data/lib/hammer_cli_foreman/smart_proxy.rb +0 -52
  25. data/lib/hammer_cli_foreman/usergroup.rb +5 -5
  26. data/lib/hammer_cli_foreman/version.rb +1 -1
  27. data/lib/hammer_cli_foreman.rb +0 -21
  28. data/lib/minitest/coverage_reporter.rb +1 -1
  29. data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  30. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  31. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  32. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  33. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  34. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  35. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  36. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  37. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  38. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  39. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  40. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  41. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  42. data/test/functional/architecture_test.rb +6 -4
  43. data/test/functional/bookmark_test.rb +3 -1
  44. data/test/functional/compute_profile_test.rb +3 -1
  45. data/test/functional/host_test.rb +0 -1
  46. data/test/functional/hostgroup/create_test.rb +0 -117
  47. data/test/functional/hostgroup/update_test.rb +0 -79
  48. data/test/functional/location_test.rb +0 -3
  49. data/test/functional/mail_notification_test.rb +3 -1
  50. data/test/functional/model_test.rb +3 -1
  51. data/test/functional/operating_system_test.rb +3 -1
  52. data/test/functional/settings_test.rb +4 -4
  53. data/test/functional/template_test.rb +4 -37
  54. data/test/functional/usergroup_test.rb +3 -1
  55. data/test/unit/apipie_resource_mock.rb +1 -39
  56. data/test/unit/architecture_test.rb +10 -10
  57. data/test/unit/bookmark_test.rb +10 -14
  58. data/test/unit/compute_profile_test.rb +10 -10
  59. data/test/unit/helpers/command.rb +0 -8
  60. data/test/unit/host_test.rb +14 -61
  61. data/test/unit/hostgroup_test.rb +7 -26
  62. data/test/unit/id_resolver_test.rb +0 -28
  63. data/test/unit/mail_notification_test.rb +4 -4
  64. data/test/unit/model_test.rb +47 -47
  65. data/test/unit/operating_system_test.rb +10 -16
  66. data/test/unit/option_sources/id_params_test.rb +9 -0
  67. data/test/unit/option_sources/ids_params_test.rb +9 -0
  68. data/test/unit/settings_test.rb +4 -4
  69. data/test/unit/smart_proxy_test.rb +0 -12
  70. data/test/unit/usergroup_test.rb +10 -10
  71. metadata +27 -48
  72. data/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb +0 -29
  73. data/lib/hammer_cli_foreman/command_extensions/puppet_environments.rb +0 -29
  74. data/lib/hammer_cli_foreman/config_group.rb +0 -45
  75. data/lib/hammer_cli_foreman/option_sources/puppet_environment_params.rb +0 -59
  76. data/lib/hammer_cli_foreman/puppet_class.rb +0 -61
  77. data/lib/hammer_cli_foreman/puppet_environment.rb +0 -65
  78. data/lib/hammer_cli_foreman/smart_class_parameter.rb +0 -189
  79. data/test/functional/config_group_test.rb +0 -50
  80. data/test/functional/proxy_test.rb +0 -86
  81. data/test/functional/smart_class_parameter_test.rb +0 -97
  82. data/test/unit/config_group_test.rb +0 -82
  83. data/test/unit/puppet_class_test.rb +0 -72
  84. data/test/unit/puppet_environment_test.rb +0 -114
  85. data/test/unit/smart_class_parameter_test.rb +0 -113
@@ -1,113 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
2
- require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
3
-
4
- require 'hammer_cli_foreman/smart_class_parameter'
5
-
6
- describe HammerCLIForeman::SmartClassParameter do
7
-
8
- include CommandTestHelper
9
-
10
- context "ListCommand" do
11
-
12
- before :each do
13
- ResourceMocks.smart_class_parameters_index
14
- end
15
-
16
- let(:cmd) { HammerCLIForeman::SmartClassParameter::ListCommand.new("", ctx) }
17
-
18
- context "parameters" do
19
- it_should_accept "no arguments"
20
- it_should_accept "hostgroup id", ["--hostgroup-id=1"]
21
- it_should_accept "host id", ["--host-id=1"]
22
- it_should_accept "environment id", ["--environment-id=1"]
23
- it_should_accept "puppet-class-id", ["--puppet-class-id=1"]
24
- it_should_accept_search_params
25
- end
26
-
27
- context "output" do
28
- let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
29
-
30
- it_should_print_n_records
31
- it_should_print_column "Id"
32
- it_should_print_column "Class Id"
33
- it_should_print_column "Puppet class"
34
- it_should_print_column "Parameter"
35
- it_should_print_column "Default Value"
36
- it_should_print_column "Override"
37
- end
38
-
39
- end
40
-
41
-
42
- context "InfoCommand" do
43
-
44
- before :each do
45
- ResourceMocks.smart_class_parameters_show
46
- end
47
-
48
- let(:cmd) { HammerCLIForeman::SmartClassParameter::InfoCommand.new("", ctx) }
49
-
50
- context "parameters" do
51
- it_should_accept "id", ["--id=1"]
52
- it_should_accept "name, puppet-class", ["--name=par", "--puppet-class=ntp"]
53
- it_should_fail_with "name", ["--name=par"]
54
- # it_should_fail_with "no arguments"
55
- # TODO: temporarily disabled, parameters are checked in the id resolver
56
- end
57
-
58
- context "output" do
59
- with_params ["--id=1"] do
60
- it_should_print_n_records 1
61
- it_should_print_columns ["Description", "Type", "Omit", "Required"]
62
- end
63
- end
64
- end
65
-
66
-
67
- context "UpdateCommand" do
68
-
69
- let(:cmd) { HammerCLIForeman::SmartClassParameter::UpdateCommand.new("", ctx) }
70
-
71
- context "parameters" do
72
- it_should_accept "id", ["--id=1"]
73
- it_should_accept "name, puppet-class", ["--name=par", "--puppet-class=ntp"]
74
- it_should_fail_with "name", ["--name=par"]
75
- it_should_accept "override", ["--id=1","--override=true"]
76
- it_should_accept "description", ["--id=1","--description=descr"]
77
- it_should_accept "default-value", ["--id=1","--default-value=1"]
78
- it_should_accept "path ", ["--id=1","--path=path"]
79
- it_should_accept "validator-type", ["--id=1","--validator-type=list"]
80
- it_should_accept "validator-rule ", ["--id=1","--validator-rule=''"]
81
- it_should_accept "override-value-order", ["--id=1","--override-value-order=fqdn"]
82
- it_should_accept "parameter-type ", ["--id=1","--parameter-type=string"]
83
- it_should_accept "required", ["--id=1","--required=true"]
84
-
85
- # it_should_fail_with "no params", []
86
- # TODO: temporarily disabled, parameters are checked in the id resolver
87
- end
88
-
89
- end
90
-
91
- context "AddMatcherCommand" do
92
-
93
- let(:cmd) { HammerCLIForeman::SmartClassParameter::AddMatcherCommand.new("", ctx) }
94
-
95
- context "parameters" do
96
- it_should_accept "smart-class-parametr-id, match, value", ["--smart-class-parameter-id=1", "--match='domain=my.lan'", "--value=1"]
97
- it_should_accept "smart-class-parameter, puppet-class, match, value", ["--smart-class-parameter=par", "--puppet-class=ntp", "--match='domain=my.lan'", "--value=1"]
98
- it_should_fail_with "smart-class-parameter, match, value", ["--smart-class-parameter=par", "--match='domain=my.lan'", "--value=1"]
99
- end
100
- end
101
-
102
- context "RemoveMatcherCommand" do
103
-
104
- let(:cmd) { HammerCLIForeman::SmartClassParameter::RemoveMatcherCommand.new("", ctx) }
105
-
106
- context "parameters" do
107
- it_should_accept "smart-class-parametr-id, id", ["--smart-class-parameter-id=1", "--id=1"]
108
- it_should_accept "smart-class-parameter, puppet-class, id", ["--smart-class-parameter=par", "--puppet-class=ntp", "--id=1"]
109
- it_should_fail_with "smart-class-parameter, id", ["--smart-class-parameter=par", "--id=1"]
110
- end
111
- end
112
-
113
- end