Project

General

Profile

Download (1.13 KB) Statistics
| Branch: | Tag: | Revision:

hammer-cli-csv / test / activation_keys_test.rb @ ee942928

1
require File.join(File.dirname(__FILE__), 'csv_test_helper')
2
require File.join(File.dirname(__FILE__), 'apipie_resource_mock')
3

    
4

    
5
describe HammerCLICsv::ActivationKeysCommand do
6

    
7
  extend CommandTestHelper
8

    
9
  before :each do
10
    @activationkey_api = ApipieResourceMock.new(KatelloApi::Resources::ActivationKey)
11
    @organization_api = ApipieResourceMock.new(KatelloApi::Resources::Organization)
12
    @environment_api = ApipieResourceMock.new(KatelloApi::Resources::Environment)
13
    @contentview_api = ApipieResourceMock.new(KatelloApi::Resources::ContentView)
14
  end
15

    
16
  context "ActivationKeysCommand" do
17

    
18
    let(:cmd) { HammerCLICsv::ActivationKeysCommand.new("", ctx) }
19

    
20
    context "parameters" do
21
      it "blah" do
22
        cmd.stubs(:get_lines).returns([
23
                                       "Name,Count,Org Label,Description,Limit,Environment,Content View,System Groups",
24
                                       "'akey',1,'org','some description','Unlimited','Library','Default_Content_view',"
25
                                      ])
26
        cmd.run(['--csv-file=some_file', '--threads=1']).must_equal HammerCLI::EX_OK
27
      end
28
    end
29
  end
30
end