Skip to content

Commit

Permalink
tests: Use the recommended network.WLAN.IF_[AP|STA] constants.
Browse files Browse the repository at this point in the history
Removes the deprecated network.[AP|STA]_IF form from unit tests.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
  • Loading branch information
projectgus authored and dpgeorge committed Nov 8, 2024
1 parent f5b81be commit 5dfbd43
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/multi_espnow/10_simple_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def init(sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e = espnow.ESPNow()
e.active(True)
e.set_pmk(default_pmk)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/20_send_echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def echo_client(e, peer, msglens):


def init(sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e = espnow.ESPNow()
e.active(True)
e.set_pmk(default_pmk)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/30_lmk_echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def echo_client(e, peer, msglens):

# Initialise the wifi and espnow hardware and software
def init(sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e = espnow.ESPNow()
e.active(True)
e.set_pmk(default_pmk)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/40_recv_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def client_send(e, peer, msg, sync):


def init(sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e = espnow.ESPNow()
e.active(True)
e.set_pmk(default_pmk)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/50_esp32_rssi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def client_send(e, peer, msg, sync):


def init(sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e = espnow.ESPNow()
e.active(True)
e.set_pmk(default_pmk)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/60_irq_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def client_send(e, peer, msg, sync):


def init(sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e = espnow.ESPNow()
e.active(True)
e.set_pmk(default_pmk)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/80_asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def client_send(e, peer, msg, sync):


def init(e, sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e.active(True)
e.set_pmk(default_pmk)
wlans[0].active(sta_active)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/81_asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def client_send(e, peer, msg, sync):


def init(e, sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e.active(True)
e.set_pmk(default_pmk)
wlans[0].active(sta_active)
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_espnow/90_memory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def echo_client(e, peer, msglens):


def init(sta_active=True, ap_active=False):
wlans = [network.WLAN(i) for i in [network.STA_IF, network.AP_IF]]
wlans = [network.WLAN(i) for i in [network.WLAN.IF_STA, network.WLAN.IF_AP]]
e = espnow.ESPNow()
e.active(True)
e.set_pmk(default_pmk)
Expand Down

0 comments on commit 5dfbd43

Please sign in to comment.