Skip to content

Commit

Permalink
Simple string input test
Browse files Browse the repository at this point in the history
  • Loading branch information
pelletier committed Jan 30, 2024
1 parent 706b116 commit be2e3fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,12 @@ def my_cool_coroutine(input: Input) -> Output:
resp = self.execute(my_cool_coroutine)
out = response_output(resp)
self.assertEqual(out, "Hello World!")

def test_string_input(self):
@self.app.dispatch_coroutine()
def my_cool_coroutine(input: Input) -> Output:
return Output.value(f"You sent '{input.input}'")

resp = self.execute(my_cool_coroutine, input="cool stuff")
out = response_output(resp)
self.assertEqual(out, "You sent 'cool stuff'")

0 comments on commit be2e3fb

Please sign in to comment.