-- Copyright (c) 2026 Huawei Technologies Co., Ltd.
-- openUBMC is licensed under Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at:
--          http://license.coscl.org.cn/MulanPSL2
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
-- EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
-- MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
-- See the Mulan PSL v2 for more details.

local lu = require('luaunit')
local chip = require('chip')
local cache = require('cache')
local context = require('mc.context')
local work_bus = require('hwproxy_objects.work_bus')

TestBlockRead = {}

function TestBlockRead:test_low_priority()
    local fetch = {}
    fetch.cb = function()
        fetch.complete = true
    end

    local chip_0001 = {
        host_bus = { name = 'unknown', notify_high_task = work_bus.notify_high_task },
        block_read_with_low_priority = chip.block_read_with_low_priority,
        high_cache = cache.new(self),
        low_cache = cache.new(self),
        accessible_status = true,
    }
    local ctx = context.new()
    fetch.complete = false
    chip_0001:block_read_with_low_priority(fetch, ctx, 0, 1)
    lu.assertEquals(fetch.complete, false)
end