def test_generate_orphans_by_type_with_unit_keys_invalid_type(self): """ Assert that when an invalid content type is passed to generate_orphans_by_type_with_unit_keys a MissingResource exception is raised. """ self.assertRaises( pulp_exceptions.MissingResource, OrphanManager.generate_orphans_by_type_with_unit_keys('Not a type').next)
def test_generate_orphans_by_type_with_unit_keys_invalid_type(self): """ Assert that when an invalid content type is passed to generate_orphans_by_type_with_unit_keys a MissingResource exception is raised. """ self.assertRaises( pulp_exceptions.MissingResource, OrphanManager.generate_orphans_by_type_with_unit_keys( 'Not a type').next)
def test_generate_orphans_by_type_with_unit_keys_invalid_type(self, mock_get_unit_key_fields): """ Assert that when an invalid content type is passed to generate_orphans_by_type_with_unit_keys a MissingResource exception is raised. """ # simulate the type not being found mock_get_unit_key_fields.side_effect = ValueError self.assertRaises( pulp_exceptions.MissingResource, OrphanManager.generate_orphans_by_type_with_unit_keys('Not a type').next)