@@ -617,3 +617,35 @@ def test_group_add_extension(self):
617617 args = p .get_docker_args (mock_cliargs )
618618 self .assertIn ('--group-add sudo' , args )
619619 self .assertIn ('--group-add docker' , args )
620+
621+ class ShmSizeExtensionTest (unittest .TestCase ):
622+
623+ def setUp (self ):
624+ # Work around interference between empy Interpreter
625+ # stdout proxy and test runner. empy installs a proxy on stdout
626+ # to be able to capture the information.
627+ # And the test runner creates a new stdout object for each test.
628+ # This breaks empy as it assumes that the proxy has persistent
629+ # between instances of the Interpreter class
630+ # empy will error with the exception
631+ # "em.Error: interpreter stdout proxy lost"
632+ em .Interpreter ._wasProxyInstalled = False
633+
634+ @pytest .mark .docker
635+ def test_shm_size_extension (self ):
636+ plugins = list_plugins ()
637+ shm_size_plugin = plugins ['shm_size' ]
638+ self .assertEqual (shm_size_plugin .get_name (), 'shm_size' )
639+
640+ p = shm_size_plugin ()
641+ self .assertTrue (plugin_load_parser_correctly (shm_size_plugin ))
642+
643+ mock_cliargs = {}
644+ self .assertEqual (p .get_snippet (mock_cliargs ), '' )
645+ self .assertEqual (p .get_preamble (mock_cliargs ), '' )
646+ args = p .get_docker_args (mock_cliargs )
647+ self .assertNotIn ('--shm-size' , args )
648+
649+ mock_cliargs = {'shm_size' : '12g' }
650+ args = p .get_docker_args (mock_cliargs )
651+ self .assertIn ('--shm-size 12g' , args )
0 commit comments