<s> from mock import call <EOL> from nose . tools import istest <EOL> from provy . more . debian import AptitudeRole , PostgreSQLRole <EOL> from tests . unit . more . base . database import test_postgresql <EOL> class PostgreSQLRoleTestCase ( test_postgresql . PostgreSQLRoleTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( PostgreSQLRoleTestCase , self ) . setUp ( ) <EOL> self . role = PostgreSQLRole ( prov = None , context = { } ) <EOL> class PostgreSQLRoleTest ( PostgreSQLRoleTestCase ) : <EOL> @ istest <EOL> def installs_necessary_packages_to_provision_to_ubuntu ( self ) : <EOL> with self . using_stub ( AptitudeRole ) as mock_aptitude , self . provisioning_to ( '<STR_LIT>' ) : <EOL> self . role . provision ( ) <EOL> install_calls = mock_aptitude . ensure_package_installed . mock_calls <EOL> self . assertEqual ( install_calls , [ call ( '<STR_LIT>' ) , call ( '<STR_LIT>' ) ] ) <EOL> @ istest <EOL> def installs_necessary_packages_to_provision_to_debian ( self ) : <EOL> with self . using_stub ( AptitudeRole ) as mock_aptitude , self . provisioning_to ( '<STR_LIT>' ) : <EOL> self . role . provision ( ) <EOL> install_calls = mock_aptitude . ensure_package_installed . mock_calls <EOL> self . assertEqual ( install_calls , [ call ( '<STR_LIT>' ) , call ( '<STR_LIT>' ) ] ) </s>
