Stoobly / stoobly-agent

Record, mock, and test HTTP/HTTPS requests. CLI agent for Stoobly.
Other
6 stars 0 forks source link

"intercept show" sub-command errors out on MOCK attribute #108

Closed stoobmmelier closed 1 year ago

stoobmmelier commented 1 year ago
$ stoobly-agent --version        
stoobly-agent, version 0.25.4

$ stoobly-agent intercept configure --mode record
Updating intercept mode to record

$ stoobly-agent intercept show
Traceback (most recent call last):
  File "/home/user/.local/bin/stoobly-agent", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/stoobly_agent/app/cli/intercept_cli.py", line 112, in show
    if active_mode == mode.MOCK:
AttributeError: 'str' object has no attribute 'MOCK'

The proxy mode gets set properly despite the error

stoobmmelier commented 1 year ago

Doesn't seem reproducible locally

$ stoobly-agent intercept show

> /home/user/.local/lib/python3.8/site-packages/stoobly_agent/app/cli/intercept_cli.py(116)show()
-> if active_mode == mode.MOCK:
(Pdb) mode
<module 'stoobly_agent.config.constants.mode' from '/home/user/.local/lib/python3.8/site-packages/stoobly_agent/config/constants/mode.py'>
(Pdb) active_mode
'record'
(Pdb) continue
Record with policy all enabled
Jvlythical commented 1 year ago

Likely fixed in a later version