diff options
author | Solly Ross <directxman12+github@gmail.com> | 2016-06-30 16:54:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 16:54:35 -0400 |
commit | 72ce5c1ae8abbcd3f8bb5f4e93915f61a1047704 (patch) | |
tree | 4a695e85ded52d92d8919bbfde03595f6250a3fb /tests | |
parent | 7d5d73873a44a23f59811344b2fc83d8fdd3e270 (diff) | |
parent | 7f8baf54e17ddcc3d467f55807b3fdda48ab5910 (diff) | |
download | websockify-72ce5c1ae8abbcd3f8bb5f4e93915f61a1047704.tar.gz |
Merge pull request #228 from jrziviani/master
Enable unix socket to work with token plugin
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_websocketproxy.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_websocketproxy.py b/tests/test_websocketproxy.py index 8e37138..b48796e 100644 --- a/tests/test_websocketproxy.py +++ b/tests/test_websocketproxy.py @@ -93,6 +93,16 @@ class ProxyRequestHandlerTestCase(unittest.TestCase): self.assertEqual(host, "some host") self.assertEqual(port, "some port") + def test_get_target_unix_socket(self): + class TestPlugin(token_plugins.BasePlugin): + def lookup(self, token): + return ("unix_socket", "/tmp/socket") + + _, socket = self.handler.get_target( + TestPlugin(None), self.handler.path) + + self.assertEqual(socket, "/tmp/socket") + def test_get_target_raises_error_on_unknown_token(self): class TestPlugin(token_plugins.BasePlugin): def lookup(self, token): |