

def _fake_usage(self, is_exists=False, is_deleted=False, mock_deployment=False):
    usage = self.mox.CreateMockAnything()
    usage.id = 1
    beginning_d = utils.decimal_utc()
    usage.instance = INSTANCE_ID_1
    launched_at = (beginning_d - (60 * 60))
    usage.launched_at = launched_at
    usage.instance_type_id = INSTANCE_TYPE_ID_1
    usage.instance_flavor_id = INSTANCE_FLAVOR_ID_1
    usage.tenant = TENANT_ID_1
    usage.os_architecture = DEFAULT_OS_ARCH
    usage.os_distro = DEFAULT_OS_DISTRO
    usage.os_version = DEFAULT_OS_VERSION
    usage.rax_options = DEFAULT_RAX_OPTIONS
    if is_exists:
        usage.deleted_at = None
    if is_deleted:
        usage.deleted_at = beginning_d
    if mock_deployment:
        deployment = self.mox.CreateMockAnything()
        deployment.name = 'RegionOne.prod.cell1'
        usage.deployment().AndReturn(deployment)
    return usage

dataset/ETHPy150Open openstack/stacktach/tests/unit/test_reconciler.py ReconcilerTestCase._fake_usage/original