This repository has been archived on 2024-12-17. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-17/src/tests/test_protocol.py

27 lines
635 B
Python
Raw Normal View History

"""
Tests for common protocol functions
"""
import unittest
from .common import skip_python3
skip_python3()
class TestProtocol(unittest.TestCase):
"""Main protocol test case"""
def test_check_local(self):
"""Check the logic of TCPConnection.local"""
from pybitmessage import protocol, state
self.assertTrue(
protocol.checkIPAddress(protocol.encodeHost('127.0.0.1'), True))
self.assertTrue(
protocol.checkIPAddress(protocol.encodeHost('192.168.0.1'), True))
self.assertTrue(
not protocol.checkSocksIP('127.0.0.1')
or state.socksIP)