class RubyRoleTest(ProvyTestCase): def setUp(self): super(RubyRoleTest, self).setUp() self.role = RubyRole(prov=None, context={}) @istest def installs_necessary_packages_to_provision(self): with self.using_stub(AptitudeRole) as aptitude, self.execute_mock() as execute: self.role.provision() update_alternatives_command = UPDATE_ALTERNATIVES_COMMAND.format( version=self.role.version, priority=self.role.priority ) aptitude.ensure_up_to_date.assert_called_once_with() aptitude.ensure_package_installed.assert_called_once_with( "ruby{version}-full".format(version=self.role.version) ) execute.assert_called_once_with(update_alternatives_command, sudo=True)
class RubyRoleTest(ProvyTestCase): def setUp(self): super(RubyRoleTest, self).setUp() self.role = RubyRole(prov=None, context={}) @istest def installs_necessary_packages_to_provision(self): with self.using_stub( AptitudeRole) as aptitude, self.execute_mock() as execute: self.role.provision() update_alternatives_command = UPDATE_ALTERNATIVES_COMMAND.format( version=self.role.version, priority=self.role.priority, ) aptitude.ensure_up_to_date.assert_called_once_with() aptitude.ensure_package_installed.assert_called_once_with( 'ruby{version}-full'.format(version=self.role.version)) execute.assert_called_once_with(update_alternatives_command, sudo=True)
def setUp(self): super(RubyRoleTest, self).setUp() self.role = RubyRole(prov=None, context={})