Author: jsuchome Date: Tue Jun 21 16:07:24 2011 New Revision: 64506 URL: http://svn.opensuse.org/viewcvs/yast?rev=64506&view=rev Log: tests for library/control/src/ProductProfile.ycp (close to useless, as the module uses non-testable Pkg) Added: branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.err branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.out branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.ycp (with props) Added: branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.err URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.err?rev=64506&view=auto ============================================================================== (empty) Added: branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.out URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.out?rev=64506&view=auto ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.out (added) +++ branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.out Tue Jun 21 16:07:24 2011 @@ -0,0 +1,4 @@ +Return true +Return $[] +Return true +Return true Added: branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.ycp?rev=64506&view=auto ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.ycp (added) +++ branches/SuSE-Code-11-SP2-Branch/yast2/library/control/testsuite/tests/ProductProfile.ycp Tue Jun 21 16:07:24 2011 @@ -0,0 +1,39 @@ +/** + * ProductProfile.ycp + * Tests of ProductProfile routines + */ +{ + // testedfiles: ProductProfile.ycp + import "Testsuite"; + import "ProductProfile"; + + map READ = $[ + "target" : $[ + "tmpdir" : "/tmp/YaST" + ], + ]; + map EX = $[ + "target" : $[ + "bash_output" : $[] + ] + ]; + + // just returns true because of non-installation mode + Testsuite::Test (``(ProductProfile::CheckCompliance (nil)), [ READ, $[], EX ], 0); + + Testsuite::Test (``(ProductProfile::compliance_checked), [], 0); + + import "Mode"; + Mode::SetMode ("installation"); + + ProductProfile::compliance_checked = $[ 1 : true ]; + + // exits on compliance_checked test + Testsuite::Test (``(ProductProfile::CheckCompliance (nil)), [ READ, $[], EX ], 0); + + Testsuite::Test (``(ProductProfile::CheckCompliance (1)), [ READ, $[], EX ], 0); + + // this would continue to IsCompliant and initialize Pkg:: + // Testsuite::Test (``(ProductProfile::CheckCompliance (2)), [ READ, $[], EX ], 0); + +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org