Author: kkaempf Date: Mon Aug 4 14:49:57 2008 New Revision: 10737 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10737&view=rev Log: - start with Python examples by moving Ruby code - use Pythons 'unittest' Added: trunk/sat-solver/bindings/python/tests/pool.py Modified: trunk/sat-solver/bindings/python/tests/loading.py Modified: trunk/sat-solver/bindings/python/tests/loading.py URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/python/tests/loading.py?rev=10737&r1=10736&r2=10737&view=diff ============================================================================== --- trunk/sat-solver/bindings/python/tests/loading.py (original) +++ trunk/sat-solver/bindings/python/tests/loading.py Mon Aug 4 14:49:57 2008 @@ -1,3 +1,13 @@ +import unittest + import sys -sys.path.append('../../../build/bindings/python') -import satsolver +sys.path.insert(0, '../../../build/bindings/python') + +class TestSequenceFunctions(unittest.TestCase): + + def testloading(self): + import satsolver + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file Added: trunk/sat-solver/bindings/python/tests/pool.py URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/python/tests/pool.py?rev=10737&view=auto ============================================================================== --- trunk/sat-solver/bindings/python/tests/pool.py (added) +++ trunk/sat-solver/bindings/python/tests/pool.py Mon Aug 4 14:49:57 2008 @@ -0,0 +1,41 @@ +# +# The Pool is the main data structure for sat-solver. +# +# It contains all solvables, grouped by Repo(sitorie)s +# and is needed to create instances of other classes. +# +# For Solvable, Repo, Transaction, Solver and Relation, +# Pool provides create_... methods as counterparts to +# the instance contructors, all requiring a Pool argument. +# +# The main object within a Pool is the Solvable. So Pool.size, +# Pool.each, Pool.get (resp. Pool[]) and Pool.find all operate +# on Solvables. +# +# For Repos there is each_repo, count_repos, get_repo and find_repo. +# + +import unittest + +import sys +sys.path.insert(0, '../../../build/bindings/python') + +import satsolver + +class TestSequenceFunctions(unittest.TestCase): + def testpool(self): + pool = satsolver.Pool() + assert pool + assert pool.count_repos() == 0 + + def testpool1(self): + pool = satsolver.Pool() + assert pool + pool.set_arch("i686") + + def testpool2(self): + pool = satsolver.Pool("i686") + assert pool + +if __name__ == '__main__': + unittest.main() -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org