Files
libtorrent/bindings/python/tests/version_test.py
T
AllSeeingEyeTolledEweSew aaa5691133 Add type stubs
2021-06-13 23:07:59 +02:00

27 lines
951 B
Python

import unittest
import libtorrent as lt
class VersionTest(unittest.TestCase):
def test_version(self) -> None:
self.assertIsInstance(lt.__version__, str)
@unittest.skip("need to implement this")
def test_version_tuple(self) -> None:
self.assertIsInstance(lt.__version_info__, tuple) # type: ignore
@unittest.skip("https://github.com/arvidn/libtorrent/issues/5967")
def test_deprecated(self) -> None:
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(lt.version, str)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(lt.version_major, int)
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(lt.version_minor, int)
def test_old_attrs(self) -> None:
self.assertIsInstance(lt.version, str)
self.assertIsInstance(lt.version_major, int)
self.assertIsInstance(lt.version_minor, int)