source: client/engine/StringLib.test.py @ f160ff2

test-python-scriptsticket-693
Last change on this file since f160ff2 was c2925f1a, checked in by Antonio Emmanuel Guerrero Silva <aguerrero@…>, 9 months ago

refs #577 Migration library from shell to python3

  • Property mode set to 100755
File size: 897 bytes
Line 
1from StringLib import ogCheckStringInGroup, ogCheckStringInReg, ogCheckIpAddress
2
3def test_functions():
4    # Prueba de ogCheckStringInGroup
5    print("Prueba de ogCheckStringInGroup")
6    element = "full-duplex"
7    group = "full-duplex half-duplex broadcast"
8    print(f"Elemento: {element}, Grupo: {group}")
9    print("Pertenece al grupo:", ogCheckStringInGroup(element, group))
10
11    # Prueba de ogCheckStringInReg
12    print("\nPrueba de ogCheckStringInReg")
13    element = "50M"
14    regex = r"^[0-9]{1,2}M$"
15    print(f"Elemento: {element}, Expresión regular: {regex}")
16    print("Coincide con la expresión regular:", ogCheckStringInReg(element, regex))
17
18    # Prueba de ogCheckIpAddress
19    print("\nPrueba de ogCheckIpAddress")
20    ip = "192.18.35.3"
21    print(f"IP: {ip}")
22    print("Es una dirección IP válida:", ogCheckIpAddress(ip))
23
24
25if __name__ == "__main__":
26    test_functions()
27
Note: See TracBrowser for help on using the repository browser.