Home / Class/ TestMACAddressDetection Class — langchain Architecture

TestMACAddressDetection Class — langchain Architecture

Architecture documentation for the TestMACAddressDetection class in test_pii.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  4cccdae9_a1dd_81c2_ea80_d6939b2dfc29["TestMACAddressDetection"]
  6dcffc03_fae9_01f8_ed9b_d30d8a73dd13["test_pii.py"]
  4cccdae9_a1dd_81c2_ea80_d6939b2dfc29 -->|defined in| 6dcffc03_fae9_01f8_ed9b_d30d8a73dd13
  b4283889_db5e_a450_6e8f_cf859a3c6587["test_detect_mac_with_colons()"]
  4cccdae9_a1dd_81c2_ea80_d6939b2dfc29 -->|method| b4283889_db5e_a450_6e8f_cf859a3c6587
  beb9164b_8f2f_ca49_c31c_3a38c969c6bf["test_detect_mac_with_dashes()"]
  4cccdae9_a1dd_81c2_ea80_d6939b2dfc29 -->|method| beb9164b_8f2f_ca49_c31c_3a38c969c6bf
  fccf6718_93ea_83cb_1a86_bfd3afc40fe4["test_detect_lowercase_mac()"]
  4cccdae9_a1dd_81c2_ea80_d6939b2dfc29 -->|method| fccf6718_93ea_83cb_1a86_bfd3afc40fe4
  eb4f8bdf_8333_7209_a5cb_66b6e0802617["test_no_mac()"]
  4cccdae9_a1dd_81c2_ea80_d6939b2dfc29 -->|method| eb4f8bdf_8333_7209_a5cb_66b6e0802617
  208d2973_9742_f580_84ad_482695b5f055["test_partial_mac_not_detected()"]
  4cccdae9_a1dd_81c2_ea80_d6939b2dfc29 -->|method| 208d2973_9742_f580_84ad_482695b5f055

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py lines 139–172

class TestMACAddressDetection:
    """Test MAC address detection."""

    def test_detect_mac_with_colons(self) -> None:
        content = "MAC: 00:1A:2B:3C:4D:5E"
        matches = detect_mac_address(content)

        assert len(matches) == 1
        assert matches[0]["type"] == "mac_address"
        assert matches[0]["value"] == "00:1A:2B:3C:4D:5E"

    def test_detect_mac_with_dashes(self) -> None:
        content = "MAC: 00-1A-2B-3C-4D-5E"
        matches = detect_mac_address(content)

        assert len(matches) == 1
        assert matches[0]["value"] == "00-1A-2B-3C-4D-5E"

    def test_detect_lowercase_mac(self) -> None:
        content = "MAC: aa:bb:cc:dd:ee:ff"
        matches = detect_mac_address(content)

        assert len(matches) == 1
        assert matches[0]["value"] == "aa:bb:cc:dd:ee:ff"

    def test_no_mac(self) -> None:
        content = "No MAC address here."
        matches = detect_mac_address(content)
        assert len(matches) == 0

    def test_partial_mac_not_detected(self) -> None:
        content = "Partial: 00:1A:2B:3C"
        matches = detect_mac_address(content)
        assert len(matches) == 0

Frequently Asked Questions

What is the TestMACAddressDetection class?
TestMACAddressDetection is a class in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py.
Where is TestMACAddressDetection defined?
TestMACAddressDetection is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_pii.py at line 139.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free