mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 04:22:09 +08:00
athena: Do not show canceled upload items in listUploadQueue (#22627)
* do not show canceled upload items in listUploadQueue * return item._asdict() * athena: updated test for listUploadQueue old-commit-hash: 12165c8865d8534e133af483cd15d7dfb3a0579a
This commit is contained in:
@@ -253,7 +253,7 @@ def uploadFileToUrl(fn, url, headers):
|
||||
@dispatcher.add_method
|
||||
def listUploadQueue():
|
||||
items = list(upload_queue.queue) + list(cur_upload_items.values())
|
||||
return [i._asdict() for i in items if i is not None]
|
||||
return [i._asdict() for i in items if i.id not in cancelled_uploads and i is not None]
|
||||
|
||||
|
||||
@dispatcher.add_method
|
||||
|
||||
@@ -245,6 +245,10 @@ class TestAthenadMethods(unittest.TestCase):
|
||||
self.assertDictEqual(items[0], item._asdict())
|
||||
self.assertFalse(items[0]['current'])
|
||||
|
||||
athenad.cancelled_uploads.add(item.id)
|
||||
items = dispatcher["listUploadQueue"]()
|
||||
self.assertEqual(len(items), 0)
|
||||
|
||||
@mock.patch('selfdrive.athena.athenad.create_connection')
|
||||
def test_startLocalProxy(self, mock_create_connection):
|
||||
end_event = threading.Event()
|
||||
|
||||
Reference in New Issue
Block a user