move telegram handle function for testing
rachmadaniHaryono opened this issue · comments
on stt module there is handle function which is used for telegram. can someone move it outside stt function, so it can be tested.
I would rather prefer to keep all the methods of input in the stt()
function itself. Why is it proving to be a problem inside the stt()
for tests?
because it can't be tested or mocked. on this line
bot.notifyOnMessage(handle)
function is used as an input. i can test bot.notifyOnMessage
is called but i can't check the input for notifyOnMessage
func. this is different with sphinx_stt
function which is also an inner funciton on the stt
function, because it is called on this line
brain.query(sphinx_stt())
the result of the sphinx_stt
function can be tested from other mocked object(open
and Decoder
)
but if this is expected, no testing required for the telegram handle
function, i will close this issue.
e: it can be internal function ( with leading single underscore in funciton name), rather than move it all directly.
Umm @rachmadaniHaryono, you are working on an old fork! The stt module has been changed since. It would be really nice if we can start merging your tests one by one rather than all at once as that might prove to be troublesome. Can we first finish the tts test PR first and then we can look to make changes according to your needs of the stt testing to prevent things from getting messy. Thanks!
This still an issue @rachmadaniHaryono?
yes, the in stt
function on master branch, the handle
function for telegram stt is still unchanged. but as i said if it is intended to do so, then we can close this issue.