test_cli: one more test, with argument split off from the name

This is probably an easier way to pass in JSON with embedded spaces:

 wormhole-server start --websocket-protocol-option 'x=["foo": "bar"]'
This commit is contained in:
Brian Warner 2017-07-15 17:39:02 -07:00
parent ba0e8997c5
commit b3b6e1ba8a

View File

@ -1248,12 +1248,15 @@ class Server(unittest.TestCase):
'--websocket-protocol-option=b=true',
'--websocket-protocol-option=c=3.5',
'--websocket-protocol-option=d=["foo","bar"]',
'--websocket-protocol-option', 'e=["foof","barf"]',
])
self.assertEqual(0, result.exit_code)
cfg = fake_start_server.mock_calls[0][1][0]
self.assertEqual(
cfg.websocket_protocol_option,
[("a", 3), ("b", True), ("c", 3.5), ("d", ['foo', 'bar'])],
[("a", 3), ("b", True), ("c", 3.5), ("d", ['foo', 'bar']),
("e", ['foof', 'barf']),
],
)
def test_broken_websocket_protocol_options(self):