commit 350ce829e71aba6e3123ca8f512d8e829fef2668 Author: Hipstercat Date: Mon May 1 14:32:06 2023 +0200 init diff --git a/main.py b/main.py new file mode 100644 index 0000000..ca97e6e --- /dev/null +++ b/main.py @@ -0,0 +1,4 @@ +from testlib import * + +if __name__ == "__main__": + TestLib().call_url("https://google.com") \ No newline at end of file diff --git a/testlib/__init__.py b/testlib/__init__.py new file mode 100644 index 0000000..b7774d2 --- /dev/null +++ b/testlib/__init__.py @@ -0,0 +1 @@ +from .testlib import * \ No newline at end of file diff --git a/testlib/testlib.py b/testlib/testlib.py new file mode 100644 index 0000000..c8da915 --- /dev/null +++ b/testlib/testlib.py @@ -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)