- name: postHoge
  category: example
  fakes:
    Accepted:
      script: |-
        async def Accepted(*args, **kwargs):
            hogeID = uuid.uuid1().hex
            await Cache.put(hogeID, "Pending", 15)
            return FakeHttpResponse(202, body=dict(hogeID=hogeID))
    Conflict:
      script: |-
        async def Conflict(*args, **kwargs):
            return FakeHttpResponse(409)
    InternalError:
      script: |-
        async def InternalError(*args, **kwargs):
            return FakeHttpResponse(500)
- category: example
  name: deleteHoge
  fakes:
    Accepted:
      script: |-
        async def Accepted(*args, **kwargs):
            hogeID = kwargs.get("path").split("/")[-1]
            await Cache.put(hogeID, "Pending", 15)
            return FakeHttpResponse(202, body=dict(hogeID=hogeID))
    InternalError:
      script: |-
        async def InternalError(*args, **kwargs):
            return FakeHttpResponse(500)
    NotFound:
      script: |-
        async def NotFound(*args, **kwargs):
            return FakeHttpResponse(404)
- category: example
  name: getHoge
  fakes:
    InternalError:
      script: |-
        async def InternalError(*args, **kwargs):
            return FakeHttpResponse(500)
    NotFound:
      script: |-
        async def NotFound(*args, **kwargs):
            return FakeHttpResponse(404)
    Success:
      script: |-
        async def Success(*args, **kwargs):
            hogeID = kwargs.get("path").split("/")[-1]
            return FakeHttpResponse(body=dict(hogeID=hogeID, status="Active"))
- category: example
  name: getHogeWaitForActive
  fakes:
    InternalError:
      script: |-
        async def InternalError(*args, **kwargs):
            return FakeHttpResponse(500)
    WaitForActive:
      script: |-
        async def Success(*args, **kwargs):
            hogeID = kwargs.get("path").split("/")[-1]
            value = await Cache.get(hogeID)
            return FakeHttpResponse(body=dict(hogeID=hogeID, status="Active" if value is None else "Processing"))
    WaitForError:
      script: |-
        async def Error(*args, **kwargs):
            hogeID = kwargs.get("path").split("/")[-1]
            value = await Cache.get(hogeID)
            return FakeHttpResponse(body=dict(hogeID=hogeID, status="Error" if value is None else "Processing"))
- category: example
  name: getHogeWaitForNotFound
  fakes:
    InternalError:
      script: |-
        async def InternalError(*args, **kwargs):
            return FakeHttpResponse(500)
    WaitForNotFound:
      script: |-
        async def WaitForNotFound(*args, **kwargs):
            hogeID = kwargs.get("path").split("/")[-1]
            value = await Cache.get(hogeID)
            if value:
                return FakeHttpResponse(body=dict(hogeID=hogeID, status="Active"))
            else:
                return FakeHttpResponse(404)
