mirror of
https://github.com/huashengdun/webssh.git
synced 2026-02-14 11:49:50 +00:00
Updated get_trusted_downstream
This commit is contained in:
@@ -122,21 +122,21 @@ class TestSettings(unittest.TestCase):
|
||||
self.assertIsNotNone(ssl_ctx)
|
||||
|
||||
def test_get_trusted_downstream(self):
|
||||
options.tdstream = ''
|
||||
tdstream = set()
|
||||
self.assertEqual(get_trusted_downstream(options), tdstream)
|
||||
tdstream = ''
|
||||
result = set()
|
||||
self.assertEqual(get_trusted_downstream(tdstream), result)
|
||||
|
||||
options.tdstream = '1.1.1.1, 2.2.2.2'
|
||||
tdstream = set(['1.1.1.1', '2.2.2.2'])
|
||||
self.assertEqual(get_trusted_downstream(options), tdstream)
|
||||
tdstream = '1.1.1.1, 2.2.2.2'
|
||||
result = set(['1.1.1.1', '2.2.2.2'])
|
||||
self.assertEqual(get_trusted_downstream(tdstream), result)
|
||||
|
||||
options.tdstream = '1.1.1.1, 2.2.2.2, 2.2.2.2'
|
||||
tdstream = set(['1.1.1.1', '2.2.2.2'])
|
||||
self.assertEqual(get_trusted_downstream(options), tdstream)
|
||||
tdstream = '1.1.1.1, 2.2.2.2, 2.2.2.2'
|
||||
result = set(['1.1.1.1', '2.2.2.2'])
|
||||
self.assertEqual(get_trusted_downstream(tdstream), result)
|
||||
|
||||
options.tdstream = '1.1.1.1, 2.2.2.'
|
||||
tdstream = '1.1.1.1, 2.2.2.'
|
||||
with self.assertRaises(ValueError):
|
||||
get_trusted_downstream(options), tdstream
|
||||
get_trusted_downstream(tdstream)
|
||||
|
||||
def test_detect_is_open_to_public(self):
|
||||
options.fbidhttp = True
|
||||
|
||||
Reference in New Issue
Block a user