def _get_dep_info(datetime=True):
    dep_info = json.loads(mock_depinfo_data.DEP_INFO)
    if not datetime:
        return dep_info

    fields = ('installed_version_time', 'latest_version_time', 'current_time')
    for _, info in dep_info.items():
        for field in fields:
            time = info[field]
            info[field] = utils._parse_datetime(time)
    return dep_info
 def test__parse_datetime_empty(self):
     res = utils._parse_datetime(None)
     self.assertIsNone(res)
 def test__parse_datetime(self):
     date_string = '2018-08-16T15:42:04.351677'
     expected = '2018-08-16 00:00:00'
     res = utils._parse_datetime(date_string)
     self.assertEqual(str(res), expected)