# Path: px/px_meminfo.py
# PAGE_SIZE_RE = re.compile(r"page size of ([0-9]+) bytes")
# SWAPUSAGE_RE = re.compile(r".*used = ([0-9.]+)M.*")
# def get_meminfo():
# def _get_ram_numbers():
# def _update_from_meminfo(base, line, name):
# def _get_ram_numbers_from_proc(proc_meminfo="/proc/meminfo"):
# def _get_ram_numbers_macos():
# def _get_vmstat_output_lines():
# def _get_used_swap_bytes_sysctl():
# def _update_if_prefix(base, line, prefix):
# def _get_ram_numbers_from_vm_stat_output(vm_stat_lines):


import os
from px import px_meminfo
    info = px_meminfo._get_ram_numbers()
    assert info is not None

    total_bytes, wanted_bytes = info
    assert total_bytes > 0
    assert wanted_bytes > 0


def test_get_ram_numbers_in_swedish():
    os.environ["LANG"] = "sv_SE.UTF-8"
    os.environ["LC_TIME"] = "sv_SE.UTF-8"
    os.environ["LC_NUMERIC"] = "sv_SE.UTF-8"

    test_get_ram_numbers_live()


def test_get_ram_numbers_from_proc_none():
    my_dir = os.path.dirname(__file__)

    info = px_meminfo._get_ram_numbers_from_proc(
        os.path.join(my_dir, "file name that doesn't exist")
    )
    assert info is None


def test_get_ram_numbers_from_proc_2010():
    my_dir = os.path.dirname(__file__)

    info = px_meminfo._get_ram_numbers_from_proc(
        os.path.join(my_dir, "proc-meminfo-2010.txt")

# Path: px/px_meminfo.py
# PAGE_SIZE_RE = re.compile(r"page size of ([0-9]+) bytes")
# SWAPUSAGE_RE = re.compile(r".*used = ([0-9.]+)M.*")
# def get_meminfo():
# def _get_ram_numbers():
# def _update_from_meminfo(base, line, name):
# def _get_ram_numbers_from_proc(proc_meminfo="/proc/meminfo"):
# def _get_ram_numbers_macos():
# def _get_vmstat_output_lines():
# def _get_used_swap_bytes_sysctl():
# def _update_if_prefix(base, line, prefix):
# def _get_ram_numbers_from_vm_stat_output(vm_stat_lines):


# Path: tests/px_meminfo_test.py
import os
from px import px_meminfo

    info = px_meminfo._get_ram_numbers()
    assert info is not None

    total_bytes, wanted_bytes = info
    assert total_bytes > 0
    assert wanted_bytes > 0


def test_get_ram_numbers_in_swedish():
    os.environ["LANG"] = "sv_SE.UTF-8"
    os.environ["LC_TIME"] = "sv_SE.UTF-8"
    os.environ["LC_NUMERIC"] = "sv_SE.UTF-8"

    test_get_ram_numbers_live()


def test_get_ram_numbers_from_proc_none():
    my_dir = os.path.dirname(__file__)

    info = px_meminfo._get_ram_numbers_from_proc(
        os.path.join(my_dir, "file name that doesn't exist")
    )
    assert info is None


def test_get_ram_numbers_from_proc_2010():
    my_dir = os.path.dirname(__file__)

    info = px_meminfo._get_ram_numbers_from_proc(
        os.path.join(my_dir, "proc-meminfo-2010.txt")

    )