format
This commit is contained in:
@ -9,3 +9,20 @@ def test_references_on_read(data_path):
|
||||
clusters = r.read(10)
|
||||
assert sys.getrefcount(clusters) == 2 #Over counts by one due to call by reference
|
||||
|
||||
def test_size_on_read(data_path):
|
||||
fname= (data_path/'beam_En700eV_-40deg_300V_10us_d0_f0_100.clust').as_posix()
|
||||
r = ClusterFileReader(fname)
|
||||
|
||||
for i in range(10):
|
||||
clusters = r.read(10)
|
||||
assert clusters.size == 10
|
||||
|
||||
def test_resize_on_read(data_path):
|
||||
# File contains 481603 clusters, output should be resized to the correct size
|
||||
fname= (data_path/'beam_En700eV_-40deg_300V_10us_d0_f0_100.clust').as_posix()
|
||||
r = ClusterFileReader(fname)
|
||||
|
||||
max_clusters = 10000000 #400MB initial allocation
|
||||
clusters = r.read(max_clusters)
|
||||
assert clusters.size == 481603
|
||||
assert sys.getrefcount(clusters) == 2
|
Reference in New Issue
Block a user