Shaman changed response does-not-existfile-unknown

Instead of 'does-not-exist' we'll now receive 'file-unknown' (see Shaman
commit 44efa6b39bddc703a14aa68316b092866813c38a)
This commit is contained in:
Sybren A. Stüvel 2019-02-28 12:34:23 +01:00
parent b22b9da5d0
commit a2f9a7b484
2 changed files with 7 additions and 4 deletions

View File

@ -30,6 +30,9 @@ import blender_asset_tracer.pack.transfer as bat_transfer
MAX_DEFERRED_PATHS = 8 MAX_DEFERRED_PATHS = 8
MAX_FAILED_PATHS = 8 MAX_FAILED_PATHS = 8
response_file_unknown = "file-unknown"
response_already_uploading = "already-uploading"
class FileInfo: class FileInfo:
def __init__(self, checksum: str, filesize: int, abspath: pathlib.Path): def __init__(self, checksum: str, filesize: int, abspath: pathlib.Path):
@ -204,9 +207,9 @@ class ShamanTransferrer(bat_transfer.FileTransferer):
self.error_set(msg) self.error_set(msg)
return None return None
if response == 'does-not-exist': if response == response_file_unknown:
to_upload.appendleft(path) to_upload.appendleft(path)
elif response == 'already-uploading': elif response == response_already_uploading:
to_upload.append(path) to_upload.append(path)
elif response == 'ERROR': elif response == 'ERROR':
msg = 'Error from Shaman: %s' % path msg = 'Error from Shaman: %s' % path

View File

@ -65,7 +65,7 @@ class AbstractChecksumTest(AbstractBlendFileTest):
self.assertEqual('text/plain', request.headers['Content-Type']) self.assertEqual('text/plain', request.headers['Content-Type'])
self.assertValidCheckoutDef(request.body) self.assertValidCheckoutDef(request.body)
body = 'does-not-exist path/in/pack/test1.blend\n' body = 'file-unknown path/in/pack/test1.blend\n'
return 200, {'Content-Type': 'text/plain'}, body return 200, {'Content-Type': 'text/plain'}, body
def mock_checkout_create(request): def mock_checkout_create(request):
@ -87,5 +87,5 @@ class AbstractChecksumTest(AbstractBlendFileTest):
trans.queue_copy(self.test_file2, pathlib.Path('/') / self.packed_names[self.test_file2]) trans.queue_copy(self.test_file2, pathlib.Path('/') / self.packed_names[self.test_file2])
trans.done_and_join() trans.done_and_join()
self.assertFalse(trans.has_error) self.assertFalse(trans.has_error, trans.error_message())
self.assertEqual('DA/-JOB-ID', trans.checkout_location) self.assertEqual('DA/-JOB-ID', trans.checkout_location)