mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-04 07:21:04 +00:00
Some more stabilization of unittests
This commit is contained in:
parent
71d9c6d0f4
commit
d60e95ede7
20 changed files with 122 additions and 33 deletions
|
|
@ -28,14 +28,26 @@ from lib.core.bigarray import BigArray
|
|||
N = 5000
|
||||
|
||||
|
||||
_SPILLED = []
|
||||
|
||||
def _make_spilled():
|
||||
# tiny chunk_size guarantees many on-disk chunks for N items
|
||||
ba = BigArray(chunk_size=1024)
|
||||
for i in range(N):
|
||||
ba.append("item-%d" % i)
|
||||
_SPILLED.append(ba) # tracked so tearDownModule closes it (release the on-disk chunk files)
|
||||
return ba
|
||||
|
||||
|
||||
def tearDownModule():
|
||||
for ba in _SPILLED:
|
||||
try:
|
||||
ba.close()
|
||||
except Exception:
|
||||
pass
|
||||
del _SPILLED[:]
|
||||
|
||||
|
||||
class TestSpill(unittest.TestCase):
|
||||
def test_actually_spilled_to_disk(self):
|
||||
ba = _make_spilled()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue