def test_copy_modified_jars_success(self):
   app_name = 'test'
   flexmock(subprocess).should_receive('call').and_return(0)
   flexmock(app_manager_server).should_receive('locate_dir').\
     and_return('/path/to/dir/')
   flexmock(shutil).should_receive('copy').and_return()
   self.assertEqual(True, app_manager_server.copy_modified_jars(app_name))  
 def test_copy_modified_jars_fail_case_1(self):
   app_name = 'test'
   flexmock(subprocess).should_receive('call').and_return(0)
   flexmock(app_manager_server).should_receive('locate_dir').\
     and_return('/path/to/dir/')
   flexmock(shutil).should_receive('copy').and_raise(IOError)
   self.assertEqual(False, app_manager_server.copy_modified_jars(app_name))
 def test_copy_modified_jars_fail_case_1(self):
   app_name = 'test'
   flexmock(subprocess).should_receive('call').and_return(0)
   flexmock(app_manager_server).should_receive('locate_dir').\
     and_return('/path/to/dir/')
   flexmock(shutil).should_receive('copy').and_raise(IOError)
   self.assertEqual(False, app_manager_server.copy_modified_jars(app_name))
 def test_copy_modified_jars_success(self):
   app_name = 'test'
   flexmock(subprocess).should_receive('call').and_return(0)
   flexmock(app_manager_server).should_receive('locate_dir').\
     and_return('/path/to/dir/')
   flexmock(shutil).should_receive('copy').and_return()
   self.assertEqual(True, app_manager_server.copy_modified_jars(app_name))  
 def test_copy_modified_jars_fail_case_2(self):
     app_name = 'test'
     flexmock(subprocess).should_receive('call').and_return(1)
     self.assertEqual(False,
                      app_manager_server.copy_modified_jars(app_name))
 def test_copy_modified_jars_success(self):
     app_name = 'test'
     flexmock(subprocess).should_receive('call').and_return(0)
     self.assertEqual(True, app_manager_server.copy_modified_jars(app_name))
Beispiel #7
0
 def test_copy_modified_jars_fail_case_2(self):
     app_name = "test"
     flexmock(subprocess).should_receive("call").and_return(1)
     self.assertEqual(False, app_manager_server.copy_modified_jars(app_name))
Beispiel #8
0
 def test_copy_modified_jars_success(self):
     app_name = "test"
     flexmock(subprocess).should_receive("call").and_return(0)
     self.assertEqual(True, app_manager_server.copy_modified_jars(app_name))
 def test_copy_modified_jars_fail_case_1(self):
   app_name = 'test'
   #return 0 the first time, 1 the second time
   flexmock(subprocess).should_receive('call').and_return(0).and_return(1)
   self.assertEqual(False, app_manager_server.copy_modified_jars(app_name))