@@ -21,14 +21,16 @@ def test_create_001():
21
21
def test_create_002 ():
22
22
with pytest .raises (ValueError ):
23
23
create (frontend_cls = None )
24
+ with pytest .raises (ValueError ):
25
+ create (transport_cls = None , backend_cls = None )
24
26
25
27
26
28
def test_create_003 (config ):
27
29
config .queue_size = 1000
28
30
config .thread_num = 10
29
31
runtime_context = RuntimeContext ()
30
- _ = create (frontend_engine_config = config ,
31
- backend_engine_config = config ,
32
+ _ = create (engine_frontend_config = config ,
33
+ engine_backend_config = config ,
32
34
runtime_context = runtime_context )
33
35
assert runtime_context .frontend_thread_queue .maxsize == config .queue_size
34
36
assert runtime_context .frontend_thread .thread_num == config .thread_num
@@ -51,3 +53,40 @@ def test_create_005(config):
51
53
_ = create (backend_cls = None , runtime_context = runtime_context )
52
54
for attr in ['backend_thread' , 'backend_thread_queue' ]:
53
55
assert not hasattr (runtime_context , attr )
56
+
57
+
58
+ def test_create_006 (config ):
59
+ runtime_context = RuntimeContext ()
60
+ config .thread_num = 10
61
+ _ = create (engine_frontend_config = config , runtime_context = runtime_context )
62
+ assert runtime_context .frontend_thread_queue .maxsize > 10
63
+
64
+
65
+ def test_create_007 (config ):
66
+ runtime_context = RuntimeContext ()
67
+ config .queue_size = 10
68
+ _ = create (engine_frontend_config = config , runtime_context = runtime_context )
69
+ assert runtime_context .frontend_thread_queue .maxsize == 10
70
+
71
+
72
+ def test_create_008 (config ):
73
+ runtime_context = RuntimeContext ()
74
+ config .thread_num = 10
75
+ _ = create (engine_backend_config = config , runtime_context = runtime_context )
76
+ assert runtime_context .backend_thread_queue .maxsize > 10
77
+
78
+
79
+ def test_create_009 (config ):
80
+ runtime_context = RuntimeContext ()
81
+ config .thread_num = 10
82
+ _ = create (transport_cls = None , engine_backend_config = config ,
83
+ runtime_context = runtime_context )
84
+ assert runtime_context .frontend_thread_queue .maxsize > 10
85
+
86
+
87
+ def test_create_010 (config ):
88
+ runtime_context = RuntimeContext ()
89
+ config .thread_num = 10
90
+ _ = create (backend_cls = None , engine_transport_config = config ,
91
+ runtime_context = runtime_context )
92
+ assert runtime_context .frontend_thread_queue .maxsize > 10
0 commit comments