Author: kkaempf Date: Mon Oct 20 14:35:54 2008 New Revision: 11402 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11402&view=rev Log: test case for dataiterator (for project 'scout') Added: trunk/sat-solver/bindings/ruby/tests/search.rb Added: trunk/sat-solver/bindings/ruby/tests/search.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/ruby/tests/search.rb?rev=11402&view=auto ============================================================================== --- trunk/sat-solver/bindings/ruby/tests/search.rb (added) +++ trunk/sat-solver/bindings/ruby/tests/search.rb Mon Oct 20 14:35:54 2008 @@ -0,0 +1,36 @@ +# +# Search +# + +$:.unshift "../../../build/bindings/ruby" + +# test Repodata +require 'test/unit' +require 'pathname' +require 'satsolver' + +class RepodataTest < Test::Unit::TestCase + def test_repo_search + pool = Satsolver::Pool.new + assert pool + pool.arch = "x86_64" + repo = pool.add_solv( Pathname( File.dirname( __FILE__ ) ) + "os11-biarch.solv" ) + repo.name = "openSUSE 11.0 Beta3 BiArch" + puts "Repo #{repo.name} loaded with #{repo.size} solvables" + + for d in repo.search("yast2", satsolver.SEARCH_STRING): + print d.solvable(), "matches 'yast2' in ", d.key(), ": ", d.value() + assert True + + def test_repo_search_files(self): + pool = satsolver.Pool() + assert pool + pool.set_arch("i686") + repo = pool.add_solv( "os11-biarch.solv" ) + repo.set_name("test") + for d in repo.search("/usr/bin/python", satsolver.SEARCH_STRING|satsolver.SEARCH_FILES): + print d.solvable(), "matches '/usr/bin/python' in ", d.key(), ": ", d.value() + assert True + +if __name__ == '__main__': + unittest.main() -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org