<s> import os <EOL> from testenv import ProcessModeTestCase <EOL> from testenv . utils import get_resource as resource <EOL> from testenv . utils import deploy_application as deploy <EOL> from testenv . processes . celery import CeleryWorkerProcess <EOL> class PluginWorkdirTest ( ProcessModeTestCase ) : <EOL> def test_plugin_workdir ( self ) : <EOL> filename = '<STR_LIT>' <EOL> host_content = '<STR_LIT>' <EOL> central_content = '<STR_LIT>' <EOL> dsl_path = resource ( "<STR_LIT>" ) <EOL> deployment , _ = deploy ( dsl_path , <EOL> inputs = { <EOL> '<STR_LIT:filename>' : filename , <EOL> '<STR_LIT>' : host_content , <EOL> '<STR_LIT>' : central_content <EOL> } ) <EOL> host_id = self . client . node_instances . list ( node_id = '<STR_LIT:host>' ) . items [ <NUM_LIT:0> ] . id <EOL> from testenv import testenv_instance <EOL> test_workdir = testenv_instance . test_working_dir <EOL> central_agent = CeleryWorkerProcess ( [ '<STR_LIT>' ] , <EOL> test_workdir ) <EOL> host_agent = CeleryWorkerProcess ( [ host_id ] , test_workdir ) <EOL> central_file = os . path . join ( <EOL> central_agent . workdir , '<STR_LIT>' , deployment . id , '<STR_LIT>' , <EOL> '<STR_LIT>' , filename ) <EOL> host_file = os . path . join ( <EOL> host_agent . workdir , '<STR_LIT>' , '<STR_LIT>' , filename ) <EOL> with open ( central_file ) as f : <EOL> self . assertEqual ( central_content , f . read ( ) ) <EOL> with open ( host_file ) as f : <EOL> self . assertEqual ( host_content , f . read ( ) ) </s>
