This commit is contained in:
Amazed 2023-05-01 14:32:06 +02:00
commit 350ce829e7
3 changed files with 34 additions and 0 deletions

4
main.py Normal file
View File

@ -0,0 +1,4 @@
from testlib import *
if __name__ == "__main__":
TestLib().call_url("https://google.com")

1
testlib/__init__.py Normal file
View File

@ -0,0 +1 @@
from .testlib import *

29
testlib/testlib.py Normal file
View File

@ -0,0 +1,29 @@
import httpx
class TestLib:
def __init__(self):
self.value = 0
self.text = "mystring"
def print(self):
print(self.value)
def set_text(self, newtext: str) -> None:
self.text = newtext
def get_uppercase(self) -> str:
"""
Return self.text in uppercase
:return: uppercased text
"""
return self.text.upper()
@staticmethod
def call_url(url: str) -> httpx.Response:
"""
Calls an URL and return response
:param url: URL to query
:return: HTTPX response
"""
return httpx.get(url)