Sha256: 8552296b049795ac7a5d1e19b40f65f1bb1c70c70dc20070ab9a429f8354966d

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

# Copyright 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the implied warranties of MERCHANTABILITY,
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
# have received a copy of GPLv2 along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.

require 'rubygems'
require 'test/integration/pulp/vcr_pulp_setup'


module FilterHelper

  @filter_resource = Resources::Pulp::Filter
  @filter_id = "integration_test_filter"

  def self.filter_id
    @filter_id
  end

  def self.create_filter
    filter = {}
    destroy_filter
    VCR.use_cassette('pulp_filter_helper') do
      filter = @filter_resource.create(:id => @filter_id, :type => "blacklist", :package_list => ['cheetah'])
    end
    return filter
  rescue Exception => e
    p "TestPulpFilter: Filter #{@filter_id} already existed."
  end

  def self.destroy_filter
    VCR.use_cassette('pulp_filter_helper') do
      @filter_resource.destroy(@filter_id)
    end
  rescue Exception => e
    p "TestPulpFilter: No filter #{@filter_id} to delete."
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
runcible-0.0.5 test/integration/resources/helpers/filter_helper.rb
runcible-0.0.4 test/integration/resources/helpers/filter_helper.rb
runcible-0.0.3 test/integration/resources/helpers/filter_helper.rb
runcible-0.0.2 test/integration/resources/helpers/filter_helper.rb
runcible-0.0.1 test/integration/resources/helpers/filter_helper.rb