File: test_packaging.py

package info (click to toggle)
python-service-identity 24.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: python: 1,454; makefile: 146
file content (26 lines) | stat: -rw-r--r-- 642 bytes parent folder | download
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
from importlib import metadata

import pytest

import service_identity


class TestLegacyMetadataHack:
    def test_version(self):
        """
        service_identity.__version__ returns the correct version.
        """
        assert (
            metadata.version("service-identity")
            == service_identity.__version__
        )

    def test_does_not_exist(self):
        """
        Asking for unsupported dunders raises an AttributeError.
        """
        with pytest.raises(
            AttributeError,
            match="module service_identity has no attribute __yolo__",
        ):
            service_identity.__yolo__