48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from ErrorsManager import ErrorsManager
|
|
|
|
class Tests:
|
|
|
|
@staticmethod
|
|
def builder() -> None:
|
|
print(ErrorsManager())
|
|
|
|
@staticmethod
|
|
def conversions() -> None:
|
|
|
|
option:str|int|list[int]
|
|
errors:ErrorsManager = ErrorsManager()
|
|
|
|
for option in (
|
|
"Hola", 923452, [45, 2, 0, 12]
|
|
):
|
|
|
|
string:str = errors.to_string(option)
|
|
integer:int = errors.to_integer(option)
|
|
array:list[int] = errors.to_array(option)
|
|
|
|
print(option)
|
|
print(["T", {
|
|
"s" : string,
|
|
"i" : integer,
|
|
"a" : array
|
|
}])
|
|
print(["S", {
|
|
"s" : errors.to_string(string),
|
|
"i" : errors.to_integer(string),
|
|
"a" : errors.to_array(string)
|
|
}])
|
|
print(["I", {
|
|
"s" : errors.to_string(integer),
|
|
"i" : errors.to_integer(integer),
|
|
"a" : errors.to_array(integer)
|
|
}])
|
|
print(["A", {
|
|
"s" : errors.to_string(array),
|
|
"i" : errors.to_integer(array),
|
|
"a" : errors.to_array(array)
|
|
}])
|
|
|
|
Tests.conversions() |