<s> import unittest <EOL> from depsolver . package import PackageInfo <EOL> from depsolver . pool import Pool <EOL> from depsolver . repository import Repository <EOL> from depsolver . request import _Job , Request <EOL> from depsolver . requirement import Requirement <EOL> from depsolver . version import SemanticVersion <EOL> P = PackageInfo . from_string <EOL> V = SemanticVersion . from_string <EOL> R = Requirement . from_string <EOL> class TestRequest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . mkl_10_3_0 = P ( "<STR_LIT>" ) <EOL> self . mkl_11_0_0 = P ( "<STR_LIT>" ) <EOL> self . numpy_1_7_0 = P ( "<STR_LIT>" ) <EOL> self . scipy_0_12_0 = P ( "<STR_LIT>" ) <EOL> repo = Repository ( [ self . mkl_10_3_0 , self . mkl_11_0_0 , self . numpy_1_7_0 , self . scipy_0_12_0 ] ) <EOL> self . pool = Pool ( [ repo ] ) <EOL> def test_simple_install ( self ) : <EOL> r_jobs = [ <EOL> _Job ( [ self . scipy_0_12_0 ] , "<STR_LIT>" , R ( "<STR_LIT>" ) ) , <EOL> _Job ( [ self . numpy_1_7_0 ] , "<STR_LIT>" , R ( "<STR_LIT>" ) ) , <EOL> ] <EOL> request = Request ( self . pool ) <EOL> request . install ( R ( "<STR_LIT>" ) ) <EOL> request . install ( R ( "<STR_LIT>" ) ) <EOL> self . assertEqual ( request . jobs , r_jobs ) <EOL> def test_simple_update ( self ) : <EOL> r_jobs = [ <EOL> _Job ( [ self . numpy_1_7_0 ] , "<STR_LIT>" , R ( "<STR_LIT>" ) ) , <EOL> ] <EOL> request = Request ( self . pool ) <EOL> request . update ( R ( "<STR_LIT>" ) ) <EOL> self . assertEqual ( request . jobs , r_jobs ) <EOL> def test_simple_remove ( self ) : <EOL> r_jobs = [ <EOL> _Job ( [ self . numpy_1_7_0 ] , "<STR_LIT>" , R ( "<STR_LIT>" ) ) , <EOL> ] <EOL> request = Request ( self . pool ) <EOL> request . remove ( R ( "<STR_LIT>" ) ) <EOL> self . assertEqual ( request . jobs , r_jobs ) <EOL> def test_simple_upgrade ( self ) : <EOL> r_jobs = [ _Job ( [ ] , "<STR_LIT>" , None ) ] <EOL> request = Request ( self . pool ) <EOL> request . upgrade ( ) <EOL> self . assertEqual ( request . jobs , r_jobs ) </s>
