test_start.py 752 B

1234567891011121314151617181920212223242526
  1. from twisted.trial import unittest
  2. from tests.utils import make_sydent
  3. class StartupTestCase(unittest.TestCase):
  4. """Test that sydent started up correctly"""
  5. def test_start(self):
  6. sydent = make_sydent()
  7. sydent.run()
  8. def test_homeserver_allow_list_refuses_to_start_if_v1_not_disabled(self):
  9. """
  10. Test that Sydent throws a runtime error if `homeserver_allow_list` is specified
  11. but the v1 API has not been disabled
  12. """
  13. config = {
  14. "general": {
  15. "homeserver_allow_list": "friendly.com, example.com",
  16. "enable_v1_access": "true",
  17. }
  18. }
  19. with self.assertRaises(RuntimeError):
  20. make_sydent(test_config=config)