示例#1
0
def test_get_group_nat_comment_empty_json(group_event):
    with mock.patch("scraper.populator.datetime") as mock_datetime:
        mock_datetime.utcnow.return_value = from_string("2020-01-01 00:01:00")
        mock_datetime.side_effect = datetime

        with mock.patch("scraper.populator.bnsite_api") as mock_bnsite_api:
            mock_bnsite_api.request_last_eval.return_value = {}

            assert get_group_bnsite_comment(group_event) is None
示例#2
0
def test_get_group_nat_comment_old(group_event):
    with mock.patch("scraper.populator.datetime") as mock_datetime:
        mock_datetime.utcnow.return_value = from_string("2020-03-08 00:01:00")
        mock_datetime.side_effect = datetime

        with mock.patch("scraper.populator.bnsite_api") as mock_bnsite_api:
            mock_bnsite_api.request_last_eval.return_value = {
                "active": False,
                "kind": "resignation",
                "updatedAt": "2020-01-01T00:00:00.000Z"
            }

            assert get_group_bnsite_comment(group_event) is None