@staticmethod
    def create_one_floating_ip(attrs=None):
        attrs = attrs or {}

        # Set default attributes.
        floating_ip_attrs = {
            'id': 'floating-ip-id-' + uuid.uuid4().hex,
            'ip': '1.0.9.0',
            'fixed_ip': '2.0.9.0',
            'instance_id': 'server-id-' + uuid.uuid4().hex,
            'pool': 'public',
        }

        # Overwrite default attributes.
        floating_ip_attrs.update(attrs)

        floating_ip = fakes.FakeResource(
            info=copy.deepcopy(floating_ip_attrs),
            loaded=True)

        return floating_ip
Create a fake floating ip.
dataset/ETHPy150Open dtroyer/python-openstackclient/openstackclient/tests/compute/v2/fakes.py/FakeFloatingIP.create_one_floating_ip