Project

General

Profile

Revision f8ecc788

Added by Thomas McKay almost 9 years ago

csv-scope - lots of cleanup

View differences:

test/setup_test.rb
9 9
  end
10 10

  
11 11
  context 'Setup Organizations' do
12
    it "hammer -v csv:organizations --csv-file test/data/organizations.csv" do
12
    it "hammer csv organizations -v --csv-file test/data/organizations.csv" do
13 13
      stdout,stderr = capture {
14
        hammer.run(%W{-v csv:organizations --csv-file test/data/organizations.csv})
14
        hammer.run(%W{csv organizations -v --csv-file test/data/organizations.csv})
15 15
      }
16 16
      stderr.must_equal ''
17 17
      stdout.must_match /.*organization 'Mega Corporation'.*/
......
19 19
  end
20 20

  
21 21
  context 'Setup Locations' do
22
    it "hammer -v csv:locations --csv-file test/data/locations.csv" do
22
    it "hammer csv locations -v --csv-file test/data/locations.csv" do
23 23
      stdout,stderr = capture {
24
        hammer.run(%W{-v csv:locations --csv-file test/data/locations.csv})
24
        hammer.run(%W{csv locations -v --csv-file test/data/locations.csv})
25 25
      }
26 26
      stderr.must_equal ''
27 27
      stdout.must_match /.*Asia Pacific.*/
......
29 29
  end
30 30

  
31 31
  context 'Setup' do
32
    it "hammer -v csv:operatingsystems --csv-file test/data/operatingsystems.csv" do
32
    it "hammer csv operating-systems -v --csv-file test/data/operatingsystems.csv" do
33 33
      stdout,stderr = capture {
34
        hammer.run(%W{-v csv:operatingsystems --csv-file test/data/operatingsystems.csv})
34
        hammer.run(%W{csv operating-systems -v --csv-file test/data/operatingsystems.csv})
35 35
      }
36 36
      stderr.must_equal ''
37 37
      stdout.must_match /.*operating system 'Fedora 18'.*/
......
39 39
  end
40 40

  
41 41
  context 'Setup' do
42
    it "hammer -v csv:architectures --csv-file test/data/architectures.csv" do
42
    it "hammer csv architectures -v --csv-file test/data/architectures.csv" do
43 43
      stdout,stderr = capture {
44
        hammer.run(%W{-v csv:architectures --csv-file test/data/architectures.csv})
44
        hammer.run(%W{csv architectures -v --csv-file test/data/architectures.csv})
45 45
      }
46 46
      stderr.must_equal ''
47 47
      stdout.must_match /.*architecture 'x86_64'.*/
......
49 49
  end
50 50

  
51 51
  context 'Setup' do
52
    it "hammer -v csv:partitiontables --csv-file test/data/partitiontables.csv" do
52
    it "hammer csv partitiontables -v --csv-file test/data/partitiontables.csv" do
53 53
      stdout,stderr = capture {
54
        hammer.run(%W{-v csv:partitiontables --csv-file test/data/partitiontables.csv})
54
        hammer.run(%W{csv partition-tables -v --csv-file test/data/partitiontables.csv})
55 55
      }
56 56
      stderr.must_equal ''
57 57
      stdout.must_match /.*ptable 'ext4 default'.*/
......
59 59
  end
60 60

  
61 61
  context 'Setup' do
62
    it "hammer -v csv:domains --csv-file test/data/domains.csv" do
62
    it "hammer csv domains -v --csv-file test/data/domains.csv" do
63 63
      stdout,stderr = capture {
64
        hammer.run(%W{-v csv:domains --csv-file test/data/domains.csv})
64
        hammer.run(%W{csv domains -v --csv-file test/data/domains.csv})
65 65
      }
66 66
      stderr.must_equal ''
67 67
      stdout.must_match /.*domain 'megacorp.com'.*/
......
69 69
  end
70 70

  
71 71
  context 'Setup' do
72
    it "hammer -v csv:puppetenvironments --csv-file test/data/puppetenvironments.csv" do
72
    it "hammer csv puppet-environments -v --csv-file test/data/puppetenvironments.csv" do
73 73
      stdout,stderr = capture {
74
        hammer.run(%W{-v csv:puppetenvironments --csv-file test/data/puppetenvironments.csv})
74
        hammer.run(%W{csv puppet-environments -v --csv-file test/data/puppetenvironments.csv})
75 75
      }
76 76
      stderr.must_equal ''
77 77
      stdout.must_match /.*environment 'Development'.*/
......
79 79
  end
80 80

  
81 81
  context 'Setup' do
82
    it "hammer -v csv:hosts --csv-file test/data/hosts.csv" do
82
    it "hammer csv hosts -v --csv-file test/data/hosts.csv" do
83 83
      stdout,stderr = capture {
84
        hammer.run(%W{-v csv:hosts --csv-file test/data/hosts.csv})
84
        hammer.run(%W{csv hosts -v --csv-file test/data/hosts.csv})
85 85
      }
86 86
      stderr.must_equal ''
87 87
      stdout.split("\n").length.must_equal 255
......
90 90
  end
91 91

  
92 92
  context 'Setup' do
93
    it "hammer -v csv:puppetfacts --csv-file test/data/puppetfacts.csv" do
93
    it "hammer csv puppet-facts -v --csv-file test/data/puppetfacts.csv" do
94 94
      stdout,stderr = capture {
95
        hammer.run(%W{-v csv:puppetfacts --csv-file test/data/puppetfacts.csv})
95
        hammer.run(%W{csv puppet-facts -v --csv-file test/data/puppetfacts.csv})
96 96
      }
97 97
      stderr.must_equal ''
98 98
      stdout.must_match /.*puppetfacts 'dhcp129-000.megacorp.com'.*/
......
100 100
  end
101 101

  
102 102
  context 'subscription setup' do
103
    it "hammer -v subscription upload --organization-id megacorp --file test/data/megacorp.zip" do
103
    it "hammer subscription upload -v --organization-id megacorp --file test/data/megacorp.zip" do
104 104
      # TODO: http://projects.theforeman.org/issues/4748
105 105
      "".must_equal "TODO: Bug #4748 - errors on import manifest should complete dynflow task and display information to user"
106 106
      stdout,stderr = capture {
......
112 112
  end
113 113

  
114 114
  context 'Setup' do
115
    it "hammer -v csv:products --csv-file test/data/products.csv" do
115
    it "hammer csv products -v --csv-file test/data/products.csv" do
116 116
      stdout,stderr = capture {
117
        hammer.run(%W{-v csv:products --csv-file test/data/products.csv})
117
        hammer.run(%W{csv products -v --csv-file test/data/products.csv})
118 118
      }
119 119
      stderr.must_equal ''
120 120
      stdout.must_match /.*product 'Point of Sale'.*/
......
122 122
  end
123 123

  
124 124
  context 'Setup' do
125
    it "hammer -v csv:lifecycleenv --csv-file test/data/lifecycleenvironments.csv" do
125
    it "hammer csv lifecycle-environments -v --csv-file test/data/lifecycleenvironments.csv" do
126 126
      stdout,stderr = capture {
127
        hammer.run(%W{-v csv:lifecycleenv --csv-file test/data/lifecycleenvironments.csv})
127
        hammer.run(%W{csv lifecycle-environments -v --csv-file test/data/lifecycleenvironments.csv})
128 128
      }
129 129
      stderr.must_equal ''
130 130
      stdout.must_match /.*environment 'Development'.*/
......
132 132
  end
133 133

  
134 134
  context 'Setup' do
135
    it "hammer -v csv:systemgroups --csv-file test/data/systemgroups.csv" do
135
    it "hammer csv system-groups -v --csv-file test/data/systemgroups.csv" do
136 136
      stdout,stderr = capture {
137
        hammer.run(%W{-v csv:systemgroups --csv-file test/data/systemgroups.csv})
137
        hammer.run(%W{csv system-groups -v --csv-file test/data/systemgroups.csv})
138 138
      }
139 139
      stderr.must_equal ''
140 140
      stdout.must_match /.*system group 'Mega Corp HQ'.*/
......
142 142
  end
143 143

  
144 144
  context 'Setup' do
145
    it "hammer -v csv:systems --csv-file test/data/systems.csv" do
145
    it "hammer csv systems -v --csv-file test/data/systems.csv" do
146 146
      stdout,stderr = capture {
147
        hammer.run(%W{-v csv:systems --csv-file test/data/systems.csv})
147
        hammer.run(%W{csv systems -v --csv-file test/data/systems.csv})
148 148
      }
149 149
      stderr.must_equal ''
150 150
      stdout.must_match /.*system 'host0'.*/
......
152 152
  end
153 153

  
154 154
  context 'Setup' do
155
    it "hammer -v csv:activationkeys --csv-file test/data/activationkeys.csv" do
155
    it "hammer csv activation-keys -v --csv-file test/data/activationkeys.csv" do
156 156
      stdout,stderr = capture {
157
        hammer.run(%W{-v csv:activationkeys --csv-file test/data/activationkeys.csv})
157
        hammer.run(%W{csv activation-keys -v --csv-file test/data/activationkeys.csv})
158 158
      }
159 159
      stderr.must_equal ''
160 160
      stdout.must_match /.*activation key 'damon\.dials@megacorp\.com'.*/

Also available in: Unified diff