fix: restore current channel and host admission organs
This commit is contained in:
parent
88ffb1c97a
commit
f46eb1b7c1
54 changed files with 4499 additions and 8 deletions
20
server-tools/persona-host-alignment/channel_context.test.py
Normal file
20
server-tools/persona-host-alignment/channel_context.test.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import unittest
|
||||
from channel_context import load_channels
|
||||
|
||||
class ChannelContextTests(unittest.TestCase):
|
||||
def test_no_implicit_default_or_permission(self):
|
||||
value = load_channels()
|
||||
self.assertIsNone(value['selected_channel'])
|
||||
self.assertFalse(value['authority_granted'])
|
||||
self.assertEqual(len(value['channels']), 4)
|
||||
|
||||
def test_every_explicit_private_channel_resolves(self):
|
||||
for id in ['ICE-CH-HB001', 'ICE-CH-LB001', 'ICE-CH-ZC001', 'ICE-CH-DK001']:
|
||||
self.assertEqual(load_channels(id)['selected_channel']['id'], id)
|
||||
|
||||
def test_public_and_unknown_not_silently_routed_private(self):
|
||||
for id in ['CH-ZERO-CORE-LPM', 'not-a-channel']:
|
||||
with self.assertRaisesRegex(ValueError, 'UNKNOWN_PRIVATE_CHANNEL'):
|
||||
load_channels(id)
|
||||
|
||||
if __name__ == '__main__': unittest.main()
|
||||
Loading…
Reference in a new issue