Finalize task visibility, selection state and active-copy uninstall protection
这个提交包含在:
1 父节点
ae3ed9c3d7
当前提交
72d678fa03
7 个文件已更改
+68
-63
没有与搜索条件相匹配的文件
@@ -6,6 +6,7 @@ import socket
|
||||
import socketserver
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
@@ -57,6 +58,20 @@ class PathBoundaryTests(unittest.TestCase):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
self.assertEqual(broker.listing(Path(folder))['path'], '')
|
||||
|
||||
def test_preparing_job_visible_before_copy_log_is_created(self):
|
||||
broker = module('broker')
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
root = Path(folder)
|
||||
job = root / 'jobs/test'
|
||||
job.mkdir(parents=True)
|
||||
(job / 'config.json').write_text(json.dumps({'uid':1000,'directories':['sample'],'destination':'/vol3/1000'}))
|
||||
(job / 'status.json').write_text(json.dumps({'phase':'preflight','started':time.time()}))
|
||||
with patch.object(broker, 'VAR', root), patch.object(broker, 'LEGACY', root / 'absent'):
|
||||
data = broker.jobs(1000)
|
||||
self.assertEqual(len(broker.active()), 1)
|
||||
self.assertEqual(len(data), 1)
|
||||
self.assertEqual(data[0]['phase'], 'preflight')
|
||||
|
||||
|
||||
class GatewayTests(unittest.TestCase):
|
||||
@classmethod
|
||||
|
||||
在新工单中引用
屏蔽一个用户