api: each API defines its 'endpoint' name

Add a new abstract class property to `BaseAPI` called `endpoint`,
meant to be implemented by deriving classes in order to identify
the end point name for the API provider.
Implement the new property in all existing API providers.
This commit is contained in:
Christian Kellner 2020-07-23 17:45:58 +02:00 committed by Tom Gundersen
parent 144019a40c
commit bc81e68727
4 changed files with 16 additions and 0 deletions

View file

@ -17,6 +17,8 @@ class APITester(osbuild.api.BaseAPI):
self.clean = False
self.messages = 0
endpoint = "test-api"
def _dispatch(self, server):
msg, _, addr = server.recv()
self.messages += 1