Sha256: 135f595a88a8ce4fb3f950aeb494a178e5ee65ce78d917c4831cd0b854fe2057

Contents?: true

Size: 1.74 KB

Versions: 1

Compression:

Stored size: 1.74 KB

Contents

require File.join(File.dirname(__FILE__), 'test_helper')
# flatten the namespace
require 'mocha'
include AWS::MWS

AWS::MWS::Base.debug = true

class FeedTest < Test::Unit::TestCase 
  def setup
    config = YAML.load_file( File.join(File.dirname(__FILE__), 'test_config.yml') )
    @marketplace = AWS::MWS::Base.new(config)
  end
  
  #def test_submit_feed
    #response = Feed.submit
    #response = Feed.submit_feed
  #end
      
  def test_get_feed_submission_list_failure
    @marketplace.stubs(:get).returns(
      mock_response(401, :body => File.read(xml_for('error')), :content_type => "text/xml")
    )

    response = @marketplace.submission_list
    assert_kind_of(ResponseError, response)
  end    
  
  def test_get_feed_submission_list_success
    @marketplace.stubs(:get).returns(
      mock_response(200, :body => File.read(xml_for('get_feed_submission_list')), :content_type => "text/xml")
    )
    
    response = @marketplace.submission_list
    assert_kind_of(GetFeedSubmissionListResponse, response)
  end
  
=begin    
  def test_get_feed_submission_list_by_next_token
    #response = Feed.submission_list_by_next_token
    #response = Feed.get_feed_submission_list_by_next_token
  end
  
  def test_get_feed_submission_list_by_next_token
    #response = Feed.submission_list_by_next_token
    #response = Feed.get_feed_submission_list_by_next_token
  end
  
  def test_get_feed_submission_count
    #response = Feed.submission_count
    #response = Feed.get_feed_submission_count
  end

  
  def test_cancel_feed_submissions
    #response = Feed.cancel_submissions
    #response = Feed.cancel_feed_submissions
  end
  
  def test_get_feed_submission_result
    #response = Feed.submission_result
    #response = Feed.get_feed_submission_result
  end
=end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amazon-mws-0.1.0 test/feed_test.rb