-
Notifications
You must be signed in to change notification settings - Fork 0
/
assert_check.py
14 lines (8 loc) · 10.5 KB
/
assert_check.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from unittest import TestCase
a = {'code': 'success', 'data': {'2017-05-23': [{'is_editable': False, 'reduced_precision': False, 'odo': None, 'id': '77982f46-127f-4bcb-bb45-e80c0a4e92a3', 'has_pending_edits': False, 'is_manual_odo': False, 'comments': None, 'editable_fields': [], 'accum_odo': 20, 'location': None, 'driver_ts': '2017-05-23 17:21:18', 'oid': '77982f46-127f-4bcb-bb45-e80c0a4e92a3', 'update_epoch': None, 'local_ts': '2017-05-23 14:21:18', 'event_type_name': 'DIAG_MAL', 'is_manual_loc': False, 'epoch': 1495574478, 'event_code_name': 'MALFUNCTION_SET', 'event_type_id': 7, 'event_record_origin_name': 'SYSTEM', 'update_user_id': None, 'mcode_name': 'POSITIONING', 'data': {'source': 'mmw', 'mcode': 'L'}, 'event_record_origin_id': 1, 'engine_hrs': None, 'event_code_id': 1, 'accum_hrs': 5}, {'is_editable': False, 'reduced_precision': False, 'odo': None, 'id': '1a40c7a8-4000-11e7-a522-94a1a275a0ca', 'has_pending_edits': False, 'is_manual_odo': False, 'comments': None, 'editable_fields': [], 'accum_odo': None, 'location': None, 'driver_ts': '2017-05-23 17:38:04', 'oid': '1a40c7a8-4000-11e7-a522-94a1a275a0ca', 'update_epoch': None, 'local_ts': '2017-05-23 14:38:04', 'event_type_name': 'DIAG_MAL', 'is_manual_loc': False, 'epoch': 1495575484, 'event_code_name': 'DIAGNOSTIC_SET', 'event_type_id': 7, 'event_record_origin_name': 'SYSTEM', 'update_user_id': None, 'data': {'source': 'tablet', 'dcode': 2}, 'event_record_origin_id': 1, 'engine_hrs': 75083, 'event_code_id': 3, 'dcode_name': 'ENGINE_SYNCH', 'accum_hrs': None}, {'is_editable': False, 'reduced_precision': False, 'odo': None, 'id': 'b0f0deec-ecd5-4548-8f6b-617a61e23e51', 'has_pending_edits': False, 'is_manual_odo': False, 'comments': '2nd certification', 'editable_fields': [], 'accum_odo': None, 'location': None, 'driver_ts': '2017-05-23 18:29:07', 'oid': 'b0f0deec-ecd5-4548-8f6b-617a61e23e51', 'update_epoch': None, 'local_ts': '2017-05-23 15:29:07', 'event_type_name': 'CERTIFICATION', 'is_manual_loc': False, 'epoch': 1495578547, 'event_code_name': 'CERT_2', 'event_type_id': 4, 'event_record_origin_name': 'DRIVER', 'update_user_id': None, 'data': {'log_day': 1495497600}, 'event_record_origin_id': 2, 'engine_hrs': None, 'event_code_id': 2, 'accum_hrs': None}], '2017-03-01': [{'is_editable': False, 'reduced_precision': False, 'odo': 886400, 'id': 'aff2326e-90f4-4033-81d0-665ae30b8348', 'has_pending_edits': False, 'is_manual_odo': False, 'comments': None, 'editable_fields': [], 'accum_odo': None, 'location': None, 'driver_ts': '2017-03-01 23:59:59', 'oid': 'aff2326e-90f4-4033-81d0-665ae30b8348', 'update_epoch': None, 'local_ts': '2017-03-01 20:59:59', 'event_type_name': 'AUTH_STATUS', 'is_manual_loc': False, 'epoch': 1488430799, 'event_code_name': 'LOGIN', 'event_type_id': 5, 'event_record_origin_name': 'NON_DRIVER', 'update_user_id': None, 'event_record_origin_id': 3, 'engine_hrs': 4599, 'event_code_id': 1, 'accum_hrs': None}, {'is_editable': False, 'reduced_precision': False, 'odo': 886400, 'id': 'c60c5aab-73f4-4330-b09e-715a5afcf5db', 'has_pending_edits': False, 'is_manual_odo': False, 'comments': None, 'editable_fields': [], 'accum_odo': None, 'location': '26mi E OR Sweet Home', 'driver_ts': '2017-03-01 02:05:00', 'oid': 'c60c5aab-73f4-4330-b09e-715a5afcf5db', 'update_epoch': None, 'local_ts': '2017-02-28 23:05:00', 'event_record_status_name': 'ACTIVE', 'event_type_name': 'INTERMEDIATE', 'is_manual_loc': False, 'event_record_status_id': 1, 'epoch': 1488351900, 'event_code_name': 'INTERMEDIATE_CONVENTIONAL_LOC', 'event_type_id': 2, 'event_record_origin_name': 'NON_DRIVER', 'update_user_id': None, 'event_record_origin_id': 3, 'engine_hrs': 4599, 'event_code_id': 1, 'accum_hrs': None}, {'historical_events': [{'reduced_precision': False, 'odo': None, 'id': '3daee3f5-b4e0-4297-8021-645fdad3017b', 'is_manual_odo': False, 'comments': 'updated duty status', 'accum_odo': None, 'location': None, 'oid': '3daee3f5-b4e0-4297-8021-645fdad3017b', 'update_epoch': 1488361600, 'local_ts': '2017-02-28 23:00:00', 'event_record_status_name': 'HISTORIC_INACTIVE', 'event_type_name': 'DUTY_STATUS', 'is_manual_loc': False, 'event_record_status_id': 2, 'epoch': 1488351600, 'event_code_name': 'OFF_DUTY', 'event_type_id': 1, 'event_record_origin_name': 'NON_DRIVER', 'update_user_id': 404, 'data': {'user_notes': 'updated duty status', 'manual_odo': 999999, 'manual_loc': 'Yard'}, 'event_record_origin_id': 3, 'engine_hrs': 4599, 'event_code_id': 1, 'accum_hrs': None}], 'is_editable': True, 'reduced_precision': False, 'odo': 999999, 'id': 'db85d448-67b1-46b1-9547-b5cd6d468550', 'has_pending_edits': False, 'is_manual_odo': True, 'comments': 'updated duty status', 'editable_fields': ['comments', 'location', 'event_code_name'], 'accum_odo': None, 'location': 'Yard', 'driver_ts': '2017-03-01 02:00:00', 'oid': '3daee3f5-b4e0-4297-8021-645fdad3017b', 'update_epoch': None, 'local_ts': '2017-02-28 23:00:00', 'event_record_status_name': 'ACTIVE', 'event_type_name': 'DUTY_STATUS', 'is_manual_loc': True, 'event_record_status_id': 1, 'epoch': 1488351600, 'event_code_name': 'OFF_DUTY', 'event_type_id': 1, 'event_record_origin_name': 'NON_DRIVER', 'update_user_id': None, 'data': {'user_notes': 'updated duty status', 'manual_odo': 999999, 'manual_loc': 'Yard'}, 'event_record_origin_id': 3, 'engine_hrs': 4599, 'event_code_id': 1, 'accum_hrs': None}]}}
b = {'code': 'success', 'data': {'2017-05-23': [{'is_editable': False, 'reduced_precision': False, 'odo': None, 'accum_odo': 20, 'id': '77982f46-127f-4bcb-bb45-e80c0a4e92a3', 'driver_ts': '2017-05-23 17:21:18', 'is_manual_odo': False, 'comments': None, 'editable_fields': [], 'epoch': 1495574478, 'location': None, 'has_pending_edits': False, 'oid': '77982f46-127f-4bcb-bb45-e80c0a4e92a3', 'update_epoch': None, 'local_ts': '2017-05-23 14:21:18', 'event_type_name': 'DIAG_MAL', 'is_manual_loc': False, 'event_code_name': 'MALFUNCTION_SET', 'event_type_id': 7, 'event_record_origin_name': 'SYSTEM', 'update_user_id': None, 'mcode_name': 'POSITIONING', 'data': {'source': 'mmw', 'mcode': 'L'}, 'event_record_origin_id': 1, 'engine_hrs': None, 'event_code_id': 1, 'accum_hrs': 5}, {'is_editable': False, 'reduced_precision': False, 'odo': None, 'accum_odo': None, 'id': '1a40c7a8-4000-11e7-a522-94a1a275a0ca', 'driver_ts': '2017-05-23 17:38:04', 'is_manual_odo': False, 'comments': None, 'editable_fields': [], 'epoch': 1495575484, 'location': None, 'has_pending_edits': False, 'oid': '1a40c7a8-4000-11e7-a522-94a1a275a0ca', 'update_epoch': None, 'local_ts': '2017-05-23 14:38:04', 'event_type_name': 'DIAG_MAL', 'is_manual_loc': False, 'event_code_name': 'DIAGNOSTIC_SET', 'event_type_id': 7, 'event_record_origin_name': 'SYSTEM', 'update_user_id': None, 'data': {'source': 'tablet', 'dcode': 2}, 'event_record_origin_id': 1, 'engine_hrs': 75083, 'event_code_id': 3, 'dcode_name': 'ENGINE_SYNCH', 'accum_hrs': None}, {'is_editable': False, 'reduced_precision': False, 'odo': None, 'accum_odo': None, 'id': 'b0f0deec-ecd5-4548-8f6b-617a61e23e51', 'driver_ts': '2017-05-23 18:29:07', 'is_manual_odo': False, 'comments': '2nd certification', 'editable_fields': [], 'epoch': 1495578547, 'location': None, 'has_pending_edits': False, 'oid': 'b0f0deec-ecd5-4548-8f6b-617a61e23e51', 'update_epoch': None, 'local_ts': '2017-05-23 15:29:07', 'event_type_name': 'CERTIFICATION', 'is_manual_loc': False, 'event_code_name': 'CERT_2', 'event_type_id': 4, 'event_record_origin_name': 'DRIVER', 'update_user_id': None, 'data': {'log_day': 1495497600}, 'event_record_origin_id': 2, 'engine_hrs': None, 'event_code_id': 2, 'accum_hrs': None}], '2017-03-01': [{'is_editable': False, 'reduced_precision': False, 'odo': 886400, 'accum_odo': None, 'id': 'aff2326e-90f4-4033-81d0-665ae30b8348', 'driver_ts': '2017-03-01 23:59:59', 'is_manual_odo': False, 'comments': None, 'editable_fields': [], 'epoch': 1488430799, 'location': None, 'has_pending_edits': False, 'oid': 'aff2326e-90f4-4033-81d0-665ae30b8348', 'update_epoch': None, 'local_ts': '2017-03-01 20:59:59', 'event_type_name': 'AUTH_STATUS', 'is_manual_loc': False, 'event_code_name': 'LOGIN', 'event_type_id': 5, 'event_record_origin_name': 'NON_DRIVER', 'update_user_id': None, 'event_record_origin_id': 3, 'engine_hrs': 4599, 'event_code_id': 1, 'accum_hrs': None}, {'local_ts': '2017-02-28 23:05:00', 'event_record_status_name': 'ACTIVE', 'event_type_name': 'INTERMEDIATE', 'is_manual_loc': False, 'event_record_status_id': 1, 'is_editable': False, 'event_code_name': 'INTERMEDIATE_CONVENTIONAL_LOC', 'event_type_id': 2, 'event_record_origin_name': 'NON_DRIVER', 'reduced_precision': False, 'update_user_id': None, 'accum_odo': None, 'editable_fields': [], 'id': 'c60c5aab-73f4-4330-b09e-715a5afcf5db', 'driver_ts': '2017-03-01 02:05:00', 'engine_hrs': 4599, 'event_code_id': 1, 'is_manual_odo': False, 'comments': None, 'event_record_origin_id': 3, 'accum_hrs': None, 'epoch': 1488351900, 'location': '26mi E OR Sweet Home', 'has_pending_edits': False, 'odo': 886400, 'oid': 'c60c5aab-73f4-4330-b09e-715a5afcf5db', 'update_epoch': None}, {'local_ts': '2017-02-28 23:00:00', 'event_record_status_name': 'ACTIVE', 'event_type_name': 'DUTY_STATUS', 'historical_events': [{'local_ts': '2017-02-28 23:00:00', 'event_record_status_name': 'PENDING_INACTIVE', 'event_type_name': 'DUTY_STATUS', 'is_manual_loc': False, 'event_record_status_id': 3, 'event_code_name': 'OFF_DUTY', 'event_type_id': 1, 'event_record_origin_name': 'NON_DRIVER', 'reduced_precision': False, 'update_user_id': 404, 'accum_odo': None, 'data': {'user_notes': 'updated duty status', 'manual_odo': 999999, 'manual_loc': 'Yard'}, 'id': '3daee3f5-b4e0-4297-8021-645fdad3017b', 'engine_hrs': 4599, 'event_code_id': 1, 'is_manual_odo': False, 'comments': 'updated duty status', 'event_record_origin_id': 3, 'accum_hrs': None, 'epoch': 1488351600, 'location': None, 'odo': None, 'oid': 'db85d448-67b1-46b1-9547-b5cd6d468550', 'update_epoch': 1488361600}], 'is_manual_loc': True, 'event_record_status_id': 1, 'is_editable': False, 'event_code_name': 'OFF_DUTY', 'event_type_id': 1, 'event_record_origin_name': 'DRIVER', 'reduced_precision': False, 'update_user_id': None, 'accum_odo': None, 'editable_fields': [], 'data': {'user_notes': 'updated duty status', 'manual_odo': 999999, 'manual_loc': 'Yard'}, 'id': 'db85d448-67b1-46b1-9547-b5cd6d468550', 'driver_ts': '2017-03-01 02:00:00', 'engine_hrs': 4599, 'event_code_id': 1, 'is_manual_odo': True, 'comments': 'updated duty status', 'event_record_origin_id': 2, 'accum_hrs': None, 'epoch': 1488351600, 'location': 'Yard', 'has_pending_edits': True, 'odo': 999999, 'oid': 'db85d448-67b1-46b1-9547-b5cd6d468550', 'update_epoch': None}]}}
class MyTest(TestCase):
def setUp(self):
self.maxDiff = None
def test(self):
self.assertEqual(a, b)