File: test_version.py

package info (click to toggle)
python-macholib 1.14%2Bds0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 492 kB
  • sloc: python: 4,125; makefile: 127
file content (28 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import sys

import macholib

if sys.version_info[:2] <= (2, 6):
    import unittest2 as unittest
else:
    import unittest


class TestVersion(unittest.TestCase):
    def test_version(self):
        fn = os.path.join(
            os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "setup.cfg"
        )
        with open(fn) as fp:
            for ln in fp:
                if ln.startswith("version"):
                    setup_version = ln.split("=")[-1].strip()
                    break
            else:
                self.fail("Cannot determine wheel version")
        self.assertEqual(setup_version, macholib.__version__)


if __name__ == "__main__":
    unittest.main()