sosol / sosol

The Son of Suda On Line
GNU General Public License v3.0
7 stars 6 forks source link

#<MediawikiApi::LoginError: EmptyPass> causes CtsPublicationsControllerTest to error #65

Open ryanfb opened 9 years ago

ryanfb commented 9 years ago

In CtsPublicationsController#create_from_agent calls, empty passwords in config/agents.yml result in a suppressed #<MediawikiApi::LoginError: EmptyPass> error (which causes the rest of the tests to error):

create_from_agent
{:uri_match=>"http://www.eagle-network.eu", :transformations=>{:CTSIdentifier=>"/data/xslt/cts/eagle-xml-perseids.xsl", :EpiCTSIdentifier=>"/data/xslt/cts/perseids-json-eagle.xsl"}, :controllers=>{"edit"=>"edittext"}, :collections=>{:CTSIdentifier=>"pdlepi"}, :type=>"mediawiki", :api_info=>{:url=>"http://www.eagle-network.eu/wiki/api.php", :data_format=>{:get=>"xml", :post=>"json"}, :auth=>{:username=>"Perseids", :password=>""}}}
#<MediawikiApi::LoginError: EmptyPass>
/Users/ryan/.rbenv/versions/jruby-1.7.19/lib/ruby/gems/shared/bundler/gems/mediawiki-ruby-api-2d87ea087c1f/lib/mediawiki_api/client.rb:94:in `log_in'
/Users/ryan/.rbenv/versions/jruby-1.7.19/lib/ruby/gems/shared/bundler/gems/mediawiki-ruby-api-2d87ea087c1f/lib/mediawiki_api/client.rb:92:in `log_in'
/Users/ryan/source/dc3/sosol/app/helpers/agent_helper.rb:64:in `initialize'
/Users/ryan/source/dc3/sosol/app/helpers/agent_helper.rb:50:in `get_client'
/Users/ryan/source/dc3/sosol/app/controllers/cts_publications_controller.rb:241:in `create_from_agent'
balmas commented 9 years ago

Sorry yes this is one I still need to make a mock for.

ryanfb commented 9 years ago

No worries, sounds good. I assume the tests in test/functional/dmm_api_controller_test.rb also need some sort of mocking, as I get various similar errors e.g.:

#<RuntimeError: Unregistered CITE Collection for urn:cite:perseus:testcoll>
/Users/ryan/source/dc3/sosol/app/models/alignment_cite_identifier.rb:227:in `api_create'
/Users/ryan/source/dc3/sosol/app/controllers/dmm_api_controller.rb:70:in `api_item_create'

For now, without those two functional tests (CtsPublicationsControllerTest and DmmApiControllerTest), I have tests passing locally.