1"""
2network server test for the CC3200 based boards.
3"""
4
5import os
6import network
7
8mch = os.uname().machine
9if not "LaunchPad" in mch and not "WiPy" in mch:
10    raise Exception("Board not supported!")
11
12server = network.Server()
13
14print(server.timeout() == 300)
15print(server.isrunning() == True)
16server.deinit()
17print(server.isrunning() == False)
18
19server.init(login=("test-user", "test-password"), timeout=60)
20print(server.isrunning() == True)
21print(server.timeout() == 60)
22
23server.deinit()
24print(server.isrunning() == False)
25server.init()
26print(server.isrunning() == True)
27
28try:
29    server.init(1)
30except:
31    print("Exception")
32
33try:
34    server.init(0, login=("0000000000011111111111222222222222333333", "abc"))
35except:
36    print("Exception")
37
38try:
39    server.timeout(1)
40except:
41    print("Exception")
42