It's a pity that the mocking key/value entries need to be alphabetical. That seems like something that'll bite us, but I'm not spotting a nicer way of handling it offhand. Oh well.
Trac: Status: new to closed Resolution: N/Ato implemented
Traceback (most recent call last): File "./return_for_args-test.py", line 19, in <module> controller.get_socks_listeners() File "stem/control.py", line 1348, in get_socks_listeners socks_port = self.get_conf('SocksPort') File "test/mocking.py", line 360, in <lambda> mock_wrapper = lambda *args, **kwargs: mock_call(*args, **kwargs) File "test/mocking.py", line 261, in _return_value raise ValueError("Unrecognized argument sent for return_for_args(). Got '%s' but weonly recognize '%s'." % (arg_label, ", ".join(args_to_return_value.keys())))TypeError: sequence item 0: expected string, tuple found
I mistakenly believed this was due to spaces in the keys in args_to_return_value, but really is was the tuple-as-key did not work in the string substitution. But, I over-corrected. Damian's revision of my fix works and gives readable output.