如何模拟xyz.capybara.clamav.commands.scan.result.ScanResult getStatus方法

时间:2019-06-13 18:13:33

标签: junit

以下是我的代码:

str

我要模拟“ result.getStatus()”。我正在使用PowerMockito模拟ScanResult

def count_threes(x):
    count = 0
    for item in x:
        if isinstance(item, str) or isinstance(item, bytes):
            continue # skip to avoid infinite recursion
        if hasattr(item, '__iter__'): # is an iterable
            count += count_threes(item)
        elif item == 3:
            count += 1
    return count

count_threes(x)
20

有人知道答案吗,请提前感谢您的帮助。

0 个答案:

没有答案