def install_bower(self, package, save=True, save_dev=False):
        """Installs a bower package.

        :param save: if `True`, pins the package to the Hydrogen requirements
            YAML file.
        :param save_dev: if `True`, pins the package as a development
            dependency to the Hydrogen requirements YAML file.
        :param return: a list of tuples, containing all installed package names
            and versions, including any dependencies.
        """
        requirement = Requirement.coerce(package)
        url = Bower.get_package_url(requirement.package)

        installed = []
        for name, _ in self.get_bower_package(url):
            installed.append(Requirement(name, requirement.version))

        for requirement in installed:
            if save:
                self.requirements["bower"].add(requirement, replace=True)
            if save_dev:
                self.requirements["bower-dev"].add(requirement, replace=True)
            success("installed {}".format(str(requirement)))
        if save or save_dev:
            self.requirements.save()
        return installed
def test_get_volume_attachment(self):
        """Test getting volume attachments

        Attach a volume to a server, and then retrieve volume's attachments
        info.
        """
        # Create a server
        server = self.create_server()
        # Verify that a volume's attachment information is retrieved
        self.volumes_client.attach_volume(self.volume['id'],
                                          instance_uuid=server['id'],
                                          mountpoint='/dev/%s' %
                                          CONF.compute.volume_device_name)
        waiters.wait_for_volume_resource_status(self.volumes_client,
                                                self.volume['id'],
                                                'in-use')
        self.addCleanup(waiters.wait_for_volume_resource_status,
                        self.volumes_client,
                        self.volume['id'], 'available')
        self.addCleanup(self.volumes_client.detach_volume, self.volume['id'])
        volume = self.volumes_client.show_volume(self.volume['id'])['volume']
        attachment = volume['attachments'][0]

        self.assertEqual('/dev/%s' %
                         CONF.compute.volume_device_name,
                         attachment['device'])
        self.assertEqual(server['id'], attachment['server_id'])
        self.assertEqual(self.volume['id'], attachment['id'])
        self.assertEqual(self.volume['id'], attachment['volume_id'])