Correcting closure for variable i
Correcting closure for variable i

Because of how python's scope model works, the "i" variable in the
lambda we were using was always referring to the last "i" of the "for"
loop, which meant we ended up not closing the first N-1 inputs, and
trying to close N times the Nth input.

We are using functools.partial to directly capture the individual
input.close functions that need to be called. A new unit test makes sure
this is working correctly too.

Signed-off-by: Rodrigo Tobar <bd955c861cbec2e41c0959cf13c7f573fa307e58@icrar.org>

steve-ord/daliuge,steve-ord/daliuge,steve-ord/daliuge,steve-ord/daliuge,steve-ord/daliuge,steve-ord/daliuge,steve-ord/daliuge