# Path: px/px_cwdfriends.py
# def _strip_leading_dash(process):
#     def __init__(self, process, all_processes, all_files):
# class PxCwdFriends(object):


from . import testutils
from px import px_cwdfriends
    from typing import List  # NOQA
    from px import px_process  # NOQA
    from six import text_type  # NOQA
import sys



if sys.version_info.major >= 3:
    # For mypy PEP-484 static typing validation


def test_current_cwd_unknown():
    process = testutils.create_process()
    test_me = px_cwdfriends.PxCwdFriends(process, [], [])
    assert test_me.cwd is None
    assert test_me.friends == []


def test_current_cwd_root():
    process = testutils.create_process(pid=123)
    cwd_file = testutils.create_file("xxx", "/", None, 123, fdtype="cwd")
    test_me = px_cwdfriends.PxCwdFriends(process, [process], [cwd_file])
    assert test_me.cwd == "/"
    assert test_me.friends == []


def test_current_cwd_notroot():
    process = testutils.create_process(pid=123)
    cwd_file = testutils.create_file("xxx", "/notroot", None, 123, fdtype="cwd")

# Path: px/px_cwdfriends.py
# def _strip_leading_dash(process):
#     def __init__(self, process, all_processes, all_files):
# class PxCwdFriends(object):


# Path: tests/px_cwdfriends_test.py
from . import testutils
from px import px_cwdfriends
    from typing import List  # NOQA
    from px import px_process  # NOQA
    from six import text_type  # NOQA
import sys




if sys.version_info.major >= 3:
    # For mypy PEP-484 static typing validation


def test_current_cwd_unknown():
    process = testutils.create_process()
    test_me = px_cwdfriends.PxCwdFriends(process, [], [])
    assert test_me.cwd is None
    assert test_me.friends == []


def test_current_cwd_root():
    process = testutils.create_process(pid=123)
    cwd_file = testutils.create_file("xxx", "/", None, 123, fdtype="cwd")
    test_me = px_cwdfriends.PxCwdFriends(process, [process], [cwd_file])
    assert test_me.cwd == "/"
    assert test_me.friends == []


def test_current_cwd_notroot():
    process = testutils.create_process(pid=123)
    cwd_file = testutils.create_file("xxx", "/notroot", None, 123, fdtype="cwd")

    test_me = px_cwdfriends.PxCwdFriends(process, [process], [cwd_file])