示例#1
0
def get_journal(
    db: Session = Depends(get_db),
    garment_id: int = Path(
        None, title="The ID of the garment to get the journal from", ge=1),
):
    garment = _get_garment(db, garment_id)
    return Journaling.get(garment.journaling_key)
示例#2
0
 def test_retrieving_a_journal_entryset(self, m_get):
     key = uuid.uuid4()
     response_mock = Mock()
     response_mock.text = '{"data": "journaling_data"}'
     response_mock.json = lambda: {"data": "journaling_data"}
     m_get.return_value = response_mock
     response = Journaling.get(key)
     m_get.assert_called_with(
         url=f"http://journaling-service:80/{str(key)}/all",
     )
     assert response["data"] == "journaling_data"