コード例 #1
0
 async def upload(self, data):
     async with await self.session.post(self.host + "/uploadfile",
                                        data=data) as resp:
         resp.raise_for_status()
     source = AsyncHttpGetter(self.host + "/readfile", {},
                              self.session,
                              time=self.time)
     return source
コード例 #2
0
async def test_download_home_assistant(reader: ReaderHelper, ui_server, snapshot, drive: DriveSource, ha: HaSource, session):
    await drive.delete(snapshot)
    # download the item from Google Drive
    from_ha = await ha.read(snapshot)
    # Download rom the web server
    from_server = AsyncHttpGetter(
        reader.getUrl() + "download?slug=" + snapshot.slug(), {}, session)
    await compareStreams(from_ha, from_server)
コード例 #3
0
async def test_download_drive(reader, ui_server, snapshot, drive: DriveSource,
                              ha: HaSource, session, time):
    await ha.delete(snapshot)
    # download the item from Google Drive
    from_drive = await drive.read(snapshot)
    # Download rom the web server
    from_server = AsyncHttpGetter(reader.getUrl() + "download?slug=" +
                                  snapshot.slug(), {},
                                  session,
                                  time=time)
    await compareStreams(from_drive, from_server)