77from testcontainers .compose import DockerCompose
88
99from .client_checks import (
10+ DEFAULT_CHANNEL_NAME ,
1011 INACTIVE_PROPERTY ,
1112 channels_match ,
1213 check_channel_property ,
@@ -39,7 +40,7 @@ class TestRestartIOC:
3940 def test_channels_same_after_restart (self , setup_compose : DockerCompose , cf_client : ChannelFinderClient ) -> None : # noqa: F811
4041 channels_begin = cf_client .find (name = "*" )
4142 restart_container (setup_compose , "ioc1-1" )
42- assert wait_for_sync (cf_client , lambda cf_client : check_channel_property (cf_client , "IOC1-1:ai:archive" ))
43+ assert wait_for_sync (cf_client , lambda cf_client : check_channel_property (cf_client , DEFAULT_CHANNEL_NAME ))
4344 channels_end = cf_client .find (name = "*" )
4445 assert len (channels_begin ) == len (channels_end )
4546 channels_match (channels_begin , channels_end , PROPERTIES_TO_MATCH )
@@ -52,12 +53,12 @@ def test_manual_channels_same_after_restart(
5253 test_property = {"name" : "test_property" , "owner" : "testowner" }
5354 cf_client .set (properties = [test_property ])
5455 test_property_value = test_property | {"value" : "test_value" }
55- channels = cf_client .find (name = "IOC1-1:ai:archive" )
56+ channels = cf_client .find (name = DEFAULT_CHANNEL_NAME )
5657 channels [0 ]["properties" ] = [test_property_value ]
5758 cf_client .set (property = test_property )
5859 channels_begin = cf_client .find (name = "*" )
5960 restart_container (setup_compose , "ioc1-1" )
60- assert wait_for_sync (cf_client , lambda cf_client : check_channel_property (cf_client , "IOC1-1:ai:archive" ))
61+ assert wait_for_sync (cf_client , lambda cf_client : check_channel_property (cf_client , DEFAULT_CHANNEL_NAME ))
6162 channels_end = cf_client .find (name = "*" )
6263 assert len (channels_begin ) == len (channels_end )
6364 channels_match (channels_begin , channels_end , PROPERTIES_TO_MATCH + ["test_property" ])
@@ -85,7 +86,7 @@ def test_status_property_works_after_cf_restart(
8586 # Assert
8687 shutdown_container (setup_compose , "ioc1-1" )
8788 assert wait_for_sync (
88- cf_client , lambda cf_client : check_channel_property (cf_client , "IOC1-1:ai:archive" , INACTIVE_PROPERTY )
89+ cf_client , lambda cf_client : check_channel_property (cf_client , DEFAULT_CHANNEL_NAME , INACTIVE_PROPERTY )
8990 )
9091 channels_inactive = cf_client .find (property = [("iocName" , "IOC1-1" )])
9192 assert all (INACTIVE_PROPERTY in ch ["properties" ] for ch in channels_inactive )
@@ -109,7 +110,7 @@ def test_status_property_works_between_cf_down(
109110
110111 # Assert
111112 assert wait_for_sync (
112- cf_client , lambda cf_client : check_channel_property (cf_client , "IOC1-1:ai:archive" , INACTIVE_PROPERTY )
113+ cf_client , lambda cf_client : check_channel_property (cf_client , DEFAULT_CHANNEL_NAME , INACTIVE_PROPERTY )
113114 )
114115 channels_inactive = cf_client .find (property = [("iocName" , "IOC1-1" )])
115116 assert all (INACTIVE_PROPERTY in ch ["properties" ] for ch in channels_inactive )
@@ -123,6 +124,6 @@ def test_move_ioc_host(
123124 ) -> None :
124125 channels_begin = cf_client .find (name = "*" )
125126 clone_container (setup_compose , "ioc1-1-new" , host_name = "ioc1-1" )
126- wait_for_sync (cf_client , lambda cf_client : check_channel_property (cf_client , "IOC1-1:ai:archive" ))
127+ wait_for_sync (cf_client , lambda cf_client : check_channel_property (cf_client , DEFAULT_CHANNEL_NAME ))
127128 channels_end = cf_client .find (name = "*" )
128129 assert len (channels_begin ) == len (channels_end )
0 commit comments