<s> """<STR_LIT>""" <EOL> import unittest <EOL> import os <EOL> import mock <EOL> from perfkitbenchmarker . linux_benchmarks import ping_benchmark <EOL> from perfkitbenchmarker import benchmark_spec <EOL> class TestGenerateJobFileString ( unittest . TestCase ) : <EOL> def testRunCountTest ( self ) : <EOL> vm_spec = mock . MagicMock ( spec = benchmark_spec . BenchmarkSpec ) <EOL> vm0 = mock . MagicMock ( ) <EOL> vm1 = mock . MagicMock ( ) <EOL> vm_spec . vms = [ vm0 , vm1 ] <EOL> path = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' , '<STR_LIT:data>' , '<STR_LIT>' ) <EOL> outfile = open ( path , '<STR_LIT:r>' ) <EOL> pingstdout = outfile . read ( ) <EOL> for vm in vm_spec . vms : <EOL> vm . RemoteCommand . side_effect = [ ( pingstdout , '<STR_LIT:U+0020>' ) ] <EOL> ping_benchmark . Prepare ( vm_spec ) <EOL> samples = ping_benchmark . Run ( vm_spec ) <EOL> ping_benchmark . Cleanup ( vm_spec ) <EOL> self . assertEquals ( vm_spec . vms [ <NUM_LIT:0> ] . RemoteCommand . call_count , <NUM_LIT:1> ) <EOL> self . assertEquals ( vm_spec . vms [ <NUM_LIT:1> ] . RemoteCommand . call_count , <NUM_LIT:1> ) <EOL> self . assertEquals ( len ( samples ) , <NUM_LIT:8> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
