File: test_version.py

package info (click to toggle)
python-libnacl 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 488 kB
  • sloc: python: 2,634; makefile: 149; sh: 3
file content (22 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Basic tests for version functions
"""

import libnacl
import unittest


# These are copied from libsodium test suite
class TestSodiumVersion(unittest.TestCase):
    def test_version_string(self):
        self.assertIsNotNone(libnacl.sodium_version_string())

    def test_library_version_major(self):
        # Using assertTrue to keep tests "uniform" and keep compatibility with
        # Python 2.6
        self.assertTrue(libnacl.sodium_library_version_major() > 0)

    def test_library_version_minor(self):
        # Using assertTrue to keep tests "uniform" and keep compatibility with
        # Python 2.6 (assertGreaterEqual appeared in Python 2.7 only)
        self.assertTrue(libnacl.sodium_library_version_minor() >= 0)