From bcef1732702704e676cc7c9f41999d9c13f8dddd Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 13 Jan 2016 17:35:54 -0800 Subject: [PATCH] Add unittest for post_session_stats() --- bindings/python/test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bindings/python/test.py b/bindings/python/test.py index 090a561bf..20988b9b4 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -73,6 +73,15 @@ class test_sha1hash(unittest.TestCase): self.assertEqual(h, str(s)) +class test_session(unittest.TestCase): + def test_post_session_stats(self): + s = lt.session({'alert_mask': lt.alert.category_t.stats_notification}) + s.post_session_stats() + a = s.wait_for_alert(1000) + self.assertTrue(isinstance(a, lt.session_stats_alert)) + self.assertTrue(isinstance(a.values, dict)) + self.assertTrue(len(a.values) > 0) + if __name__ == '__main__': print(lt.__version__) unittest.main()