| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import unittest |
||
| 2 | from backend.fcmapp import ApplicationService |
||
| 3 | from domain.mining import AvailablePool |
||
| 4 | from messaging.schema import AvailablePoolSchema |
||
| 5 | |||
| 6 | class TestApp(unittest.TestCase): |
||
| 7 | def test_app_json_serialize(self): |
||
| 8 | app = ApplicationService(component='test') |
||
| 9 | pool = AvailablePool('S9', None, 'url', 'user', 'x', 0) |
||
| 10 | strpool = app.jsonserialize(AvailablePoolSchema(), pool) |
||
| 11 | self.assertTrue(isinstance(strpool, str)) |
||
| 12 | self.assertFalse(strpool.startswith('[')) |
||
| 13 | |||
| 14 | def test_app_knownpools(self): |
||
| 15 | app = ApplicationService(component='test') |
||
| 16 | app.startup() |
||
| 17 | pools = app.knownpools() |
||
| 18 | self.assertTrue(len(pools) > 0) |
||
| 19 | for pool in pools: |
||
| 20 | self.assertTrue(isinstance(pool, AvailablePool)) |
||
| 21 | |||
| 22 | if __name__ == '__main__': |
||
| 23 | unittest.main() |
||
| 24 |