llama.test.test_utils module¶
Testing for utils.py
-
llama.test.test_utils.
memoize_func_helper
(**memoize_args)¶ Test
utils.memoize
for functions on both persistent and in-memory memoization (persistent memoization is available to functions only, not methods). Takes arguments to be passed toutils.memoize
.
-
llama.test.test_utils.
memoize_helper
(*returnvals)¶ Creates a function that can only be called once to make sure that
memoize
doesn’t unnecessarily get called many times.- Parameters
returnvals (iterable) – The values that
called_once
should return (regardless of input args). If only one argument is provided, then that value will be returned. If multiple arguments are provided, they will be returned as a tuple. If no arguments are provided, then there will be no return value, i.e.None
will be returned.- Returns
called_once – A function that can only be called once (or else it raises an
AssertionError
.- Return type
function
-
llama.test.test_utils.
test_get_grid_make_grid
()¶ Test
utils.get_grid
. Simply see if we can make a grid.
-
llama.test.test_utils.
test_get_grid_north_pole
()¶ Test
utils.get_grid
. See if we can place a point at the north pole.
-
llama.test.test_utils.
test_memoize
()¶ Test in-memory
memoize
on a function.
-
llama.test.test_utils.
test_memoize_class
()¶ Test
utils.memoize
for classes.
-
llama.test.test_utils.
test_memoize_helper
()¶ Test the
memoize_helper
. Returned function should raise anAssertionError
when called more than once.
-
llama.test.test_utils.
test_rotate_angs2vec
()¶ Test
utils.rotate_angs2vec
.
-
llama.test.test_utils.
test_write_gzip
()¶ Test
utils.write_gzip
.