init
This commit is contained in:
commit
350ce829e7
4
main.py
Normal file
4
main.py
Normal file
@ -0,0 +1,4 @@
|
||||
from testlib import *
|
||||
|
||||
if __name__ == "__main__":
|
||||
TestLib().call_url("https://google.com")
|
1
testlib/__init__.py
Normal file
1
testlib/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .testlib import *
|
29
testlib/testlib.py
Normal file
29
testlib/testlib.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user