Esempio n. 1
0
 def test_client_time(self):
     self.data['fileSystemInfo'] = get_data('facets/filesysteminfo_facet.json')
     self.assertNotEqual(self.data['fileSystemInfo']['createdDateTime'], self.data['createdDateTime'])
     self.assertNotEqual(self.data['fileSystemInfo']['lastModifiedDateTime'], self.data['lastModifiedDateTime'])
     item = items.OneDriveItem(get_sample_drive_object(), self.data)
     self.assert_timestamps(self.data['fileSystemInfo'], item)
     self.assert_timestamps(self.data['fileSystemInfo'], item.fs_info)
Esempio n. 2
0
 def setUp(self):
     self.data = get_data('image_item.json')
     self.data['audio'] = get_data('facets/audio_facet.json')
     self.data['deleted'] = get_data('facets/deleted_facet.json')
     self.data['photo'] = get_data('facets/photo_facet.json')
     self.data['video'] = get_data('facets/video_facet.json')
     self.data['specialFolder'] = get_data('facets/specialfolder_facet.json')
     self.data['location'] = get_data('facets/location_facet.json')
     self.data['parentReference'] = get_data('item_reference.json')
     self.item = items.OneDriveItem(drive=get_sample_drive_object(), data=self.data)
Esempio n. 3
0
 def test_update_item(self):
     data = self.all_items_data[0]
     self.assertNotEqual('12345767', data['file']['hashes']['crc32Hash'])
     data['file']['hashes']['crc32Hash'] = '12345767'
     self.assertNotEqual('/drive/root:/foo',
                         data['parentReference']['path'])
     data['parentReference']['path'] = '/drive/root:/foo'
     self.assertNotEqual('2020-01-20T03:04:05.06Z',
                         data['lastModifiedDateTime'])
     data['lastModifiedDateTime'] = '2020-01-20T03:04:05.06Z'
     item = items.OneDriveItem(self.drive, data)
     status = items_db.ItemRecordStatuses.MOVING
     self.itemdb.update_item(item, status)
     records = self.itemdb.get_items_by_id(item_id=item.id)
     self.assert_item_record(item, records, status)
Esempio n. 4
0
 def setUp(self):
     self.data = get_data('drive_root.json')
     self.item = items.OneDriveItem(drive=get_sample_drive_object(), data=self.data)
Esempio n. 5
0
 def test_time_fallback(self):
     item = items.OneDriveItem(get_sample_drive_object(), self.data)
     self.assert_timestamps(self.data, item)
Esempio n. 6
0
 def _add_item(self, filename):
     data = get_data(filename)
     item = items.OneDriveItem(self.drive, data)
     self.itemdb.update_item(item, items_db.ItemRecordStatuses.OK)
     self.all_items.append(item)
     self.all_items_data.append(data)