mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Add unit test for Struct_mallinfo2.__str__()
This commit is contained in:
parent
763dcacfd3
commit
519b892f0c
@ -50,6 +50,7 @@ class Struct_mallinfo2(ctypes.Structure):
|
||||
)
|
||||
s += f"{'fordblks': <10}= {(self.fordblks/2**30):15.5f} # Space in free blocks (non-mmapped) (GB)\n"
|
||||
s += f"{'keepcost': <10}= {(self.keepcost/2**30):15.5f} # Top-most, releasable space (GB)\n"
|
||||
return s
|
||||
|
||||
|
||||
class LibcUtil:
|
||||
|
@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from invokeai.backend.model_management.libc_util import LibcUtil
|
||||
from invokeai.backend.model_management.libc_util import LibcUtil, Struct_mallinfo2
|
||||
|
||||
|
||||
def test_libc_util_mallinfo2():
|
||||
@ -14,3 +14,10 @@ def test_libc_util_mallinfo2():
|
||||
info = libc.mallinfo2()
|
||||
|
||||
assert info.arena > 0
|
||||
|
||||
|
||||
def test_struct_mallinfo2_to_str():
|
||||
"""Smoke test of Struct_mallinfo2.__str__()."""
|
||||
info = Struct_mallinfo2()
|
||||
info_str = str(info)
|
||||
print(info_str)
|
||||
|
Loading…
x
Reference in New Issue
Block a user