local pd_service = require 'pd.pd_identify_service'
local lu = require 'luaunit'

Test_Pd_Identify_Service = {}

function Test_Pd_Identify_Service:test_on_add_drive()
    local on_presence = {}
    local tmp_del = pd_service.del_drive
    local tmp_subhealth = pd_service.set_subhealth_default_values

    pd_service.del_drive = function (drive)
    end

    pd_service.set_subhealth_default_values = function (drive)
    end

    function on_presence:on(add_identify_service)
        add_identify_service(false)
    end
    local drives = {
        presence = 0,
        on_presence_changed = on_presence
    }
    pd_service:on_add_drive_call_back(drives)
    lu.assertEquals(drives.Missing, 0)

    pd_service.set_subhealth_default_values = tmp_subhealth
    pd_service.del_drive = tmp_del
end