def test_update_autonomous_database_cpu_core_count(
        db_client, check_and_update_resource_patch):
    autonomous_database = get_autonomous_database()
    autonomous_database.cpu_core_count = 4
    module = get_module(
        dict({"autonomous_database_id": "ocid1.autonomousdatabase.aaa"}))
    check_and_update_resource_patch.return_value = {
        "autonomous_database": to_dict(autonomous_database),
        "changed": True,
    }
    result = oci_autonomous_database.update_autonomous_database(
        db_client, module)
    assert result["changed"] is True
def test_update_autonomous_database_defined_tags(
        db_client, check_and_update_resource_patch):
    autonomous_database = get_autonomous_database()
    module = get_module(
        dict(defined_tags=dict(system_strength=dict(shape='medium')),
             autonomous_database_id='ocid1.autonomousdatabase.aaa'))
    check_and_update_resource_patch.return_value = {
        'autonomous_database': to_dict(autonomous_database),
        'changed': True
    }
    result = oci_autonomous_database.update_autonomous_database(
        db_client, module)
    assert result['changed'] is True
def test_update_autonomous_database_freeform_tags(
        db_client, check_and_update_resource_patch):
    autonomous_database = get_autonomous_database()
    module = get_module(
        dict(freeform_tags=dict(system_type='oracledb'),
             autonomous_database_id='ocid1.autonomousdatabase.aaa'))
    check_and_update_resource_patch.return_value = {
        'autonomous_database': to_dict(autonomous_database),
        'changed': True
    }
    result = oci_autonomous_database.update_autonomous_database(
        db_client, module)
    assert result['changed'] is True
def test_update_autonomous_database_cpu_core_count(
        db_client, check_and_update_resource_patch):
    autonomous_database = get_autonomous_database()
    autonomous_database.cpu_core_count = 4
    module = get_module(
        dict({'autonomous_database_id': 'ocid1.autonomousdatabase.aaa'}))
    check_and_update_resource_patch.return_value = {
        'autonomous_database': to_dict(autonomous_database),
        'changed': True
    }
    result = oci_autonomous_database.update_autonomous_database(
        db_client, module)
    assert result['changed'] is True
def test_update_autonomous_database_defined_tags(
        db_client, check_and_update_resource_patch):
    autonomous_database = get_autonomous_database()
    module = get_module(
        dict(
            defined_tags=dict(system_strength=dict(shape="medium")),
            autonomous_database_id="ocid1.autonomousdatabase.aaa",
        ))
    check_and_update_resource_patch.return_value = {
        "autonomous_database": to_dict(autonomous_database),
        "changed": True,
    }
    result = oci_autonomous_database.update_autonomous_database(
        db_client, module)
    assert result["changed"] is True
def test_update_autonomous_database_freeform_tags(
        db_client, check_and_update_resource_patch):
    autonomous_database = get_autonomous_database()
    module = get_module(
        dict(
            freeform_tags=dict(system_type="oracledb"),
            autonomous_database_id="ocid1.autonomousdatabase.aaa",
        ))
    check_and_update_resource_patch.return_value = {
        "autonomous_database": to_dict(autonomous_database),
        "changed": True,
    }
    result = oci_autonomous_database.update_autonomous_database(
        db_client, module)
    assert result["changed"] is True