summaryrefslogtreecommitdiffstatshomepage
path: root/tests/esp32/resolve_on_connect.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-01-18 16:32:31 +1100
committerDamien George <damien@micropython.org>2024-01-22 11:48:27 +1100
commit7bbcee3cf09a08199b3ffefb6c5e37208cba5f0a (patch)
tree6260794d34aaef18fcf5a6521ff3d103bc962dbf /tests/esp32/resolve_on_connect.py
parentf93ffc2875c57ce3b8a608ebf5ae9050aa62f069 (diff)
downloadmicropython-7bbcee3cf09a08199b3ffefb6c5e37208cba5f0a.tar.gz
micropython-7bbcee3cf09a08199b3ffefb6c5e37208cba5f0a.zip
tests: Move port-specific test directories into tests/ports/ directory.
To keep them all together, mirroring the top-level directory structure. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/esp32/resolve_on_connect.py')
-rw-r--r--tests/esp32/resolve_on_connect.py56
1 files changed, 0 insertions, 56 deletions
diff --git a/tests/esp32/resolve_on_connect.py b/tests/esp32/resolve_on_connect.py
deleted file mode 100644
index e604ce9ca0..0000000000
--- a/tests/esp32/resolve_on_connect.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Test that the esp32's socket module performs DNS resolutions on bind and connect
-import sys
-
-if sys.implementation.name == "micropython" and sys.platform != "esp32":
- print("SKIP")
- raise SystemExit
-
-import socket, sys
-
-
-def test_bind_resolves_0_0_0_0():
- s = socket.socket()
- try:
- s.bind(("0.0.0.0", 31245))
- print("bind actually bound")
- s.close()
- except Exception as e:
- print("bind raised", e)
-
-
-def test_bind_resolves_localhost():
- s = socket.socket()
- try:
- s.bind(("localhost", 31245))
- print("bind actually bound")
- s.close()
- except Exception as e:
- print("bind raised", e)
-
-
-def test_connect_resolves():
- s = socket.socket()
- try:
- s.connect(("micropython.org", 80))
- print("connect actually connected")
- s.close()
- except Exception as e:
- print("connect raised", e)
-
-
-def test_connect_non_existent():
- s = socket.socket()
- try:
- s.connect(("nonexistent.example.com", 80))
- print("connect actually connected")
- s.close()
- except OSError as e:
- print("connect raised OSError")
- except Exception as e:
- print("connect raised", e)
-
-
-test_funs = [n for n in dir() if n.startswith("test_")]
-for f in sorted(test_funs):
- print("--", f, end=": ")
- eval(f + "()")