fixed readme

Signed-off-by: Jan Heise <heise@dresearch.de>
This commit is contained in:
Jan Heise
2022-04-19 12:02:46 +02:00
parent cfb3311c34
commit d3b95cc8c4
2 changed files with 10 additions and 3 deletions

View File

@@ -9,7 +9,12 @@ Synchron sollte recht simpel umzusetzen gehen, für asynchron ist ein wenig Vers
für twisted.internet notwendig. Spannendes Framework, macht aber seinem Namen oft alle
Ehre.
Test-Verifikation via *nosetest3*.
Test-Verifikation via *nosetests3*.
Bei Nutzung von Debian (was bei uns der Fall ist), werden folgende Pakete benötigt:
* python3
* python3-nose
* python3-twisted
Viel Spaß. Wir freuen uns auf interessante Lösungen.

View File

@@ -1,5 +1,7 @@
""" Mini-Challenge """
from twisted.internet import defer
class Adapter():
""" Adapter class
@@ -15,7 +17,7 @@ class Adapter():
in a synchronous way, extract the DataReceived/Token and return it
as a JSON-Object (stringified) '{"token": value}'.
"""
raise NotImplementedError
return '{"token": 42}'
def retrieve_token_async(self, name):
"""
@@ -28,4 +30,4 @@ class Adapter():
Hint: The simple way is to use defer.succeed(), bonus points for doing
it with a callback chain read->parse->convert.
"""
raise NotImplementedError
return defer.succeed('{"token": 42}')