add missing assertion for return value in unit-test
add mocks to prevent exception in __del__ during unit-test