1919 encoding = "utf-8" ,
2020)
2121
22+ BASE_CHANNEL_COUNT = 9
2223setup_compose = ComposeFixtureFactory (Path ("docker" ) / Path ("test-bash-ioc.yml" )).return_fixture ()
2324
2425
@@ -39,7 +40,6 @@ def stream_logs(exec_result, cmd: str):
3940 )
4041 log_thread .start ()
4142
42-
4343def start_ioc (setup_compose : DockerCompose ) -> Container :
4444 ioc_container = setup_compose .get_container ("ioc1-1" )
4545 docker_client = DockerClient ()
@@ -75,7 +75,7 @@ def test_remove_infotag(self, setup_compose: DockerCompose) -> None: # noqa: F8
7575 # Arrange
7676 docker_ioc = start_ioc (setup_compose )
7777 LOG .info ("Waiting for channels to sync" )
78- cf_client = create_client_and_wait (setup_compose , expected_channel_count = 8 )
78+ cf_client = create_client_and_wait (setup_compose , expected_channel_count = BASE_CHANNEL_COUNT )
7979
8080 # Check before
8181 LOG .debug ('Checking ioc1-1 has ai:base_record with info tag "archive"' )
@@ -94,3 +94,28 @@ def get_len_archive_properties(base_channel):
9494 base_channel = cf_client .find (name = base_channel_name )
9595 LOG .debug ("archive channel: %s" , base_channel )
9696 assert get_len_archive_properties (base_channel ) == 0
97+
98+
99+ class TestRemoveChannel :
100+ def test_remove_channel (self , setup_compose : DockerCompose ) -> None : # noqa: F811
101+ """
102+ Test that removing a channel works correctly.
103+ """
104+ # Arrange
105+ docker_ioc = start_ioc (setup_compose )
106+ LOG .info ("Waiting for channels to sync" )
107+ cf_client = create_client_and_wait (setup_compose , expected_channel_count = BASE_CHANNEL_COUNT )
108+
109+ # Check ioc1-1 has base channel
110+ LOG .debug ('Checking ioc1-1 has ai:base_record2"' )
111+ base_channel_name = "IOC1-1:ai:base_record"
112+ base_channel_test_name = "IOC1-1:ai:base_record2"
113+ check_channel_property (cf_client , name = base_channel_name )
114+ check_channel_property (cf_client , name = base_channel_test_name )
115+
116+ # Act
117+ restart_ioc (docker_ioc , cf_client , base_channel_name , "st_remove_channel" )
118+
119+ # Assert
120+ check_channel_property (cf_client , name = base_channel_name )
121+ check_channel_property (cf_client , name = base_channel_test_name , prop = INACTIVE_PROPERTY )
0 commit comments