Skip to content

Commit

Permalink
Configure testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr committed Mar 22, 2024
1 parent 30d0b4f commit 7f4db95
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
15 changes: 15 additions & 0 deletions src/geodienste_api.py
Original file line number Diff line number Diff line change
@@ -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 []
16 changes: 16 additions & 0 deletions test/test_geodienste_api.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 7f4db95

Please sign in to comment.