devkapilbansal
Newcomer
Greetings everyone
I want to test some files using ubus in my local machine(ubuntu) The script uses:-
This script is loaded in another module, ubus was giving nil, that's why I try to mock it using package.loaded. But now the line data = ubus:call(something) is giving error as:
Actually, I wanna use a predefined output file for data while testing. How the value of ubus.connect():call(something) can be mocked
I want to test some files using ubus in my local machine(ubuntu) The script uses:-
Lua:
ubus_lib = require('ubus')
ubus = ubus_lib.connect()
data = ubus:call(something)
Bash:
lua: ../interface_functions.lua:12: attempt to index global 'ubus' (a nil value)
stack traceback:
../interface_functions.lua:12: in main chunk
[C]: in function 'require'
test_interface.lua:7: in main chunk
[C]: ?
Actually, I wanna use a predefined output file for data while testing. How the value of ubus.connect():call(something) can be mocked