File: test_build.py

package info (click to toggle)
python-argon2-cffi-bindings 25.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: python: 108; makefile: 8
file content (21 lines) | stat: -rw-r--r-- 551 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
import pytest

from _argon2_cffi_bindings._ffi_build import _get_target_platform


@pytest.mark.parametrize(
    ("arch_flags", "expected"),
    [
        (" -arch arm64", "arm64"),
        ("abc -arch  arm64  xyz", "arm64"),
        ("abc -arch  aRm64  xyz", "arm64"),
        ("nonsense ", "FOO"),
        ("", "FOO"),
    ],
)
def test_arch(arch_flags, expected):
    """
    _get_target_platform parses ARCHFLAGS and returns the default value if
    it doesn't find anything.
    """
    assert expected == _get_target_platform(arch_flags, "FOO")