diff --git a/.vscode/settings.json b/.vscode/settings.json index d855e4e..34ed784 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,8 @@ "azureFunctions.projectLanguage": "Python", "azureFunctions.projectRuntime": "~4", "debug.internalConsoleOptions": "neverOpen", - "azureFunctions.projectLanguageModel": 2 + "azureFunctions.projectLanguageModel": 2, + "python.testing.unittestArgs": ["-v", "-s", "./test", "-p", "test_*.py"], + "python.testing.pytestEnabled": false, + "python.testing.unittestEnabled": true } diff --git a/src/geodienste_api.py b/src/geodienste_api.py new file mode 100644 index 0000000..2a493a7 --- /dev/null +++ b/src/geodienste_api.py @@ -0,0 +1,15 @@ +class GeodiensteApi: + """Handles all calls to the geodienste API""" + + def __init__(self): + print("GeodiensteApi initialized") + + def topic_has_changed(self, topic_name: str): + """Check if the topic has changed since the last call""" + print("Checking for changes in topics", topic_name) + return True + + def get_topics(self, topic_name: str): + """Get all topics""" + print("Getting the topic ", topic_name, " from the API") + return [] diff --git a/test/test_geodienste_api.py b/test/test_geodienste_api.py new file mode 100644 index 0000000..1cf73a0 --- /dev/null +++ b/test/test_geodienste_api.py @@ -0,0 +1,16 @@ +import unittest +from src.geodienste_api import GeodiensteApi + + +class TestGeodiensteApi(unittest.TestCase): + """Test class for Geodienste API""" + + def test_topic_has_changed(self): + """Test if the topic has changed""" + geodienste_api = GeodiensteApi() + geodienste_api.topic_has_changed("test_topic") + self.assertEqual(True, True) + + +if __name__ == "__main__": + unittest.main()