diff options
author | NavaL <ayoyo@thoughtworks.com> | 2016-06-24 18:37:25 +0200 |
---|---|---|
committer | NavaL <ayoyo@thoughtworks.com> | 2016-06-24 18:37:55 +0200 |
commit | 64c54186eff000762c291758973ca8e5db28f606 (patch) | |
tree | ca90b7c74583cfa170e90838b5722b96ba7138da /service/test/unit/config | |
parent | 12706c25ef02974ff54d1f42caac268f6eaa3a0c (diff) |
Issue #694 add an admin restricted resource for user stats
Diffstat (limited to 'service/test/unit/config')
-rw-r--r-- | service/test/unit/config/test_services.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/service/test/unit/config/test_services.py b/service/test/unit/config/test_services.py index 71765d19..8277c919 100644 --- a/service/test/unit/config/test_services.py +++ b/service/test/unit/config/test_services.py @@ -17,7 +17,7 @@ import unittest from mockito import mock, verify -from pixelated.config.services import Services +from pixelated.config.services import Services, ServicesFactory class ServicesTest(unittest.TestCase): @@ -32,3 +32,13 @@ class ServicesTest(unittest.TestCase): def test_close_services_closes_the_underlying_leap_session(self): self.services.close() verify(self.leap_session).close() + + +class ServicesFactoryTest(unittest.TestCase): + + def test_online_sessions_counts_logged_in_users(self): + service_factory = ServicesFactory(mock()) + service_factory.add_session('some_id1', mock()) + service_factory.add_session('some_id2', mock()) + + self.assertEqual(2, service_factory.online_sessions()) |