Module ImportFrom alias alias Import alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad keyword NameLoad keyword Dict decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body FunctionDef arguments args defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr Num decorator_list Assign NameStore Call NameLoad keyword NameLoad With Call NameLoad Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body With Call AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str body Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore BinOpMod Str TupleLoad SubscriptLoad Call NameLoad NameLoad Slice Num Str With Call AttributeLoad NameLoad attr NameStore body With Call AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Str With Call AttributeLoad NameLoad attr NameStore body With Call AttributeLoad NameLoad attr Str NameStore body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str Str Str Str body Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str Str Str Str body Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Assign AttributeStore NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameStore body Assign AttributeStore NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str body Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str Str body With Call AttributeLoad NameLoad attr NameLoad Str NameStore body Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str Str Str body Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str Str Str body Assign AttributeStore AttributeLoad NameLoad attr attr Str Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameLoad Str NameStore body With Call AttributeLoad NameLoad attr Str Str body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore BinOpSub NameLoad Call NameLoad keyword Num Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameLoad Str NameStore body With Call AttributeLoad NameLoad attr Str Str body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore BinOpSub NameLoad Call NameLoad keyword Num Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list NameLoad decorator_list
N/A datetime datetime timedelta N/A sys base64 b64encode mock MagicMock patch nose.tools istest provy.more.debian AptitudeRole PackageNotFound provy.more.debian.package aptitude tests.unit.tools.helpers ProvyTestCase AptitudeRoleTest N/A ProvyTestCase N/A setUp N/A N/A self N/A N/A N/A N/A N/A N/A super AptitudeRoleTest self setUp N/A N/A self role N/A AptitudeRole prov None context N/A N/A checks_that_a_package_exists N/A N/A self N/A N/A N/A N/A N/A self execute_mock execute N/A N/A N/A N/A self assertTrue N/A N/A N/A self role package_exists python N/A N/A N/A execute assert_called_with aptitude show python stdout False N/A istest checks_that_a_package_doesnt_exist N/A N/A self N/A N/A N/A N/A N/A self execute_mock execute N/A N/A N/A execute return_value False N/A N/A N/A self assertFalse N/A N/A N/A self role package_exists phyton N/A N/A N/A execute assert_called_with aptitude show phyton stdout False N/A istest traps_sys_exit_when_checking_if_a_package_exists N/A N/A self N/A N/A exit N/A N/A N/A args kwargs N/A N/A N/A N/A sys exit 1 N/A N/A execute N/A MagicMock side_effect exit N/A N/A patch provy.core.roles.Role.execute execute N/A N/A N/A N/A self assertFalse N/A N/A N/A self role package_exists phyton N/A istest checks_that_a_package_is_installed N/A N/A self N/A N/A N/A N/A N/A self execute_mock execute N/A N/A N/A execute return_value 
            foo
            bar
             N/A N/A N/A self assertTrue N/A N/A N/A self role is_package_installed foo N/A N/A N/A execute assert_called_once_with dpkg -l | egrep 'ii[ ]*foo\b' stdout False sudo True N/A istest checks_that_a_package_is_not_installed N/A N/A self N/A N/A N/A N/A N/A self execute_mock execute N/A N/A N/A execute return_value 
            foo
            bar
             N/A N/A N/A self assertFalse N/A N/A N/A self role is_package_installed baz N/A N/A N/A execute assert_called_once_with dpkg -l | egrep 'ii[ ]*baz\b' stdout False sudo True N/A istest checks_if_a_package_exists_before_installing N/A N/A self N/A N/A N/A N/A N/A self execute_mock execute N/A N/A N/A N/A self mock_role_method package_exists package_exists N/A N/A N/A package_exists return_value True N/A result N/A N/A N/A self role ensure_package_installed python N/A N/A N/A self assertTrue result N/A N/A N/A self assertTrue N/A package_exists called N/A N/A N/A execute assert_called_with aptitude install -y python stdout False sudo True N/A istest fails_to_install_package_if_it_doesnt_exist N/A N/A self N/A N/A N/A N/A N/A self execute_mock N/A N/A N/A N/A self mock_role_method package_exists package_exists N/A N/A N/A package_exists return_value False N/A N/A N/A self assertRaises PackageNotFound N/A N/A self role ensure_package_installed phyton N/A N/A N/A self assertTrue N/A package_exists called N/A istest doesnt_install_package_if_already_installed N/A N/A self N/A N/A N/A N/A N/A self mock_role_method is_package_installed N/A N/A N/A N/A N/A self role is_package_installed return_value True N/A result N/A N/A N/A self role ensure_package_installed python N/A N/A N/A self assertFalse result N/A istest ensure_source_must_generate_correct_source_file N/A N/A self N/A N/A N/A source_line deb http://example.org/pub/ubuntu natty main restricted N/A expected_file N/A %s_%s N/A N/A N/A b64encode source_line N/A 12 example.org N/A N/A N/A self execute_mock execute N/A N/A N/A N/A self mock_role_method has_source has_source N/A N/A N/A has_source return_value False N/A N/A N/A N/A self role ensure_aptitude_source source_line N/A N/A N/A self assertTrue N/A has_source called N/A N/A N/A execute assert_called_with N/A echo "%s" >> /etc/apt/sources.list.d/%s.list N/A source_line expected_file stdout False sudo True N/A istest doesnt_add_source_if_it_already_exists N/A N/A self N/A N/A N/A source_line deb http://example.org/pub/ubuntu natty main restricted N/A N/A N/A self execute_mock execute N/A N/A N/A N/A self mock_role_method has_source has_source N/A N/A N/A has_source return_value True N/A N/A N/A self assertFalse N/A N/A N/A self role ensure_aptitude_source source_line N/A N/A N/A self assertFalse N/A execute called N/A istest installs_necessary_packages_to_provision N/A N/A self N/A N/A N/A N/A N/A self mock_role_methods execute ensure_up_to_date ensure_package_installed is_package_installed N/A N/A N/A N/A N/A self role is_package_installed return_value False N/A N/A N/A N/A self role provision N/A N/A N/A N/A N/A self role is_package_installed assert_called_once_with aptitude N/A N/A N/A N/A N/A self role execute assert_called_once_with apt-get install aptitude -y stdout False sudo True N/A N/A N/A N/A N/A self role ensure_up_to_date assert_called_once_with N/A N/A N/A N/A N/A self role ensure_package_installed assert_called_once_with curl N/A istest doesnt_install_aptitude_if_already_installed_when_provisioning N/A N/A self N/A N/A N/A N/A N/A self mock_role_methods execute ensure_up_to_date ensure_package_installed is_package_installed N/A N/A N/A N/A N/A self role is_package_installed return_value True N/A N/A N/A N/A self role provision N/A N/A N/A N/A N/A self role is_package_installed assert_called_once_with aptitude N/A N/A N/A self assertFalse N/A N/A N/A self role execute called N/A N/A N/A N/A N/A self role ensure_up_to_date assert_called_once_with N/A N/A N/A N/A N/A self role ensure_package_installed assert_called_once_with curl N/A istest ensures_gpg_key_is_added N/A N/A self N/A N/A N/A N/A N/A self execute_mock N/A N/A N/A N/A N/A self role ensure_gpg_key http://some.repo N/A N/A N/A N/A N/A self role execute assert_called_once_with curl http://some.repo | apt-key add - stdout False sudo True N/A istest checks_that_repository_exists_in_apt_source N/A N/A self N/A N/A N/A N/A N/A self execute_mock execute N/A N/A N/A execute return_value 1 N/A result N/A N/A N/A self role has_source foo-bar N/A N/A N/A self assertTrue result N/A N/A N/A execute assert_called_once_with grep -ilR '^foo-bar' /etc/apt/sources.list /etc/apt/sources.list.d | wc -l sudo True stdout False N/A istest checks_that_repository_doesnt_exist_in_apt_source N/A N/A self N/A N/A N/A N/A N/A self execute_mock execute N/A N/A N/A execute return_value 0 N/A result N/A N/A N/A self role has_source foo-bar N/A N/A N/A self assertFalse result N/A istest gets_update_date_file_as_a_property N/A N/A self N/A N/A N/A N/A N/A self mock_role_method remote_temp_dir N/A N/A N/A N/A N/A self role remote_temp_dir return_value /foo/bar N/A N/A N/A self assertEqual N/A N/A self role update_date_file /foo/bar/last_aptitude_update N/A istest stores_update_date N/A N/A self N/A N/A N/A N/A N/A self mock_role_methods update_date_file execute N/A N/A N/A N/A patch object aptitude datetime mock_datetime N/A N/A N/A N/A self role update_date_file /foo/bar N/A when N/A N/A datetime strptime 2013-01-01 %Y-%m-%d N/A N/A N/A mock_datetime now return_value when N/A N/A N/A N/A self role store_update_date N/A N/A N/A N/A N/A self role execute assert_called_once_with echo "01-01-13 00:00:00" > /foo/bar stdout False N/A istest gets_last_update_date N/A N/A self N/A N/A N/A N/A N/A self mock_role_methods remote_exists update_date_file read_remote_file N/A N/A N/A N/A self role update_date_file /foo/bar N/A N/A N/A N/A self role remote_exists return_value True N/A N/A N/A N/A self role read_remote_file return_value 01-01-13 00:00:00 N/A result N/A N/A N/A self role get_last_update_date N/A N/A N/A self assertEqual result N/A N/A datetime strptime 2013-01-01 %Y-%m-%d N/A N/A N/A N/A N/A self role remote_exists assert_called_once_with N/A N/A self role update_date_file N/A N/A N/A N/A N/A self role read_remote_file assert_called_once_with N/A N/A self role update_date_file N/A istest gets_none_as_last_update_if_there_was_no_update_yet N/A N/A self N/A N/A N/A N/A N/A self mock_role_methods remote_exists update_date_file read_remote_file N/A N/A N/A N/A self role update_date_file /foo/bar N/A N/A N/A N/A self role remote_exists return_value False N/A result N/A N/A N/A self role get_last_update_date N/A N/A N/A self assertIsNone result N/A N/A N/A self assertFalse N/A N/A N/A self role read_remote_file called N/A istest updates_aptitude_when_passed_time_limit N/A N/A self N/A N/A N/A N/A N/A patch object aptitude datetime mock_datetime N/A N/A N/A N/A self mock_role_methods get_last_update_date force_update N/A N/A now N/A N/A datetime strptime 2013-01-01 %Y-%m-%d N/A then N/A now N/A timedelta minutes 31 N/A N/A N/A mock_datetime now return_value now N/A N/A N/A N/A self role get_last_update_date return_value then N/A N/A N/A N/A self role ensure_up_to_date N/A N/A N/A N/A N/A self role get_last_update_date assert_called_once_with N/A N/A N/A N/A N/A self role force_update assert_called_once_with N/A istest doesnt_update_if_not_passed_from_time_limit N/A N/A self N/A N/A N/A N/A N/A patch object aptitude datetime mock_datetime N/A N/A N/A N/A self mock_role_methods get_last_update_date force_update N/A N/A now N/A N/A datetime strptime 2013-01-01 %Y-%m-%d N/A then N/A now N/A timedelta minutes 29 N/A N/A N/A mock_datetime now return_value now N/A N/A N/A N/A self role get_last_update_date return_value then N/A N/A N/A N/A self role ensure_up_to_date N/A N/A N/A self assertFalse N/A N/A N/A self role force_update called N/A istest forces_an_update N/A N/A self N/A N/A N/A N/A N/A self mock_role_methods execute store_update_date N/A N/A N/A N/A N/A self role force_update N/A N/A N/A self assertTrue N/A N/A N/A self role context N/A aptitude-up-to-date N/A N/A N/A N/A N/A self role execute assert_called_once_with aptitude update stdout False sudo True N/A N/A N/A N/A N/A self role store_update_date assert_called_once_with N/A istest N/A