ogClonningEnginetest-python-scriptsticket-577ticket-585ticket-693ticket-700
Last change
on this file since 6482bcc 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 | |
---|
1 | from StringLib import ogCheckStringInGroup, ogCheckStringInReg, ogCheckIpAddress |
---|
2 | |
---|
3 | def 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 | |
---|
25 | if __name__ == "__main__": |
---|
26 | test_functions() |
---|
27 | |
---|
Note: See
TracBrowser
for help on using the repository browser.