def test_undo_undoes_changes(self): resp = self.app.post_json( '/refactor/rename', { 'name': 'Llama', 'path': 'basic/foo.py', 'offset': 8, }) if resp.json['result'] != 'success': print(resp.json['message']) self.assertEqual(resp.json['result'], 'success') task_id = resp.json['task_id'] self.assertTrue( wait_for_task(task_id, self.app)) with self.assertRaises(ValueError): common.compare_projects( 'basic', 'main', 'basic') resp = self.app.post_json( '/history/undo', {'index': 0}) self.assertEqual(resp.json['result'], 'success') common.compare_projects( 'basic', 'main', 'basic')
def test_undo_undoes_changes(self): rsp_data = json_request( url='http://{}:{}/refactor/rename'.format( self.host, self.port), data={ 'name': 'Llama', 'path': 'basic/foo.py', 'offset': 8, }) self.assertEqual(rsp_data['result'], 'success') task_id = rsp_data['task_id'] self.assertTrue( wait_for_task(task_id, self.host, self.port)) with self.assertRaises(ValueError): common.compare_projects( 'basic', 'main', 'basic') rsp_data = json_request( url='http://{}:{}/history/undo'.format( self.host, self.port), data={'index': 0}) self.assertEqual(rsp_data['result'], 'success') common.compare_projects( 'basic', 'main', 'basic')
def test_cross_remove_argument(self): self.proj.remove_argument(self.task_state, 1, 'basic/bar.py', 163).get() common.compare_projects('cross_basic_remove_argument', 'main', 'basic') common.compare_projects('cross_use_bar_remove_argument', 'cross', 'use_bar')
def test_undo_undoes_changes(self): self.proj.rename(self.task_state, 'Llama', 'basic/foo.py', 8).get() with self.assertRaises(ValueError): common.compare_projects('basic', 'main', 'basic') self.proj.undo().get() common.compare_projects('basic', 'main', 'basic')
def test_cross_normalize_arguments(self): self.proj.normalize_arguments(self.task_state, 'basic/bar.py', 163).get() common.compare_projects('cross_basic_normalize_arguments', 'main', 'basic') common.compare_projects('cross_use_bar_normalize_arguments', 'cross', 'use_bar')
def test_simple(self): self.proj.rename( self.task_state, 'Llama', 'basic/foo.py', 8).get() common.compare_projects( 'basic_rename_llama', 'main', 'basic')
def test_with_kwargs(self): self.proj.change_options = {'docs': True} self.proj.rename( self.task_state, 'Llama', 'basic/foo.py', 8).get() common.compare_projects( 'basic_rename_llama', 'main', 'basic')
def test_rename(self): resp = self.app.post_json('/refactor/rename', { 'name': 'Llama', 'path': 'basic/foo.py', 'offset': 8, }) self.assertEqual(resp.json['result'], 'success') task_id = resp.json['task_id'] self.assertTrue(wait_for_task(task_id, self.app)) common.compare_projects('basic_rename_llama', 'main', 'basic')
def test_cross_normalize_arguments(self): self.proj.normalize_arguments( self.task_state, 'basic/bar.py', 163).get() common.compare_projects( 'cross_basic_normalize_arguments', 'main', 'basic') common.compare_projects( 'cross_use_bar_normalize_arguments', 'cross', 'use_bar')
def test_cross_remove_argument(self): self.proj.remove_argument( self.task_state, 1, 'basic/bar.py', 163).get() common.compare_projects( 'cross_basic_remove_argument', 'main', 'basic') common.compare_projects( 'cross_use_bar_remove_argument', 'cross', 'use_bar')
def test_undo_undoes_changes(self): rename(self.proj, self.task_state, 'Llama', 'basic/foo.py', 8) with self.assertRaises(ValueError): common.compare_projects( 'basic', 'main', 'basic') history.undo(self.proj) common.compare_projects( 'basic', 'main', 'basic')
def test_rename(self): resp = self.app.post_json( '/refactor/rename', { 'name': 'Llama', 'path': 'basic/foo.py', 'offset': 8, }) self.assertEqual(resp.json['result'], 'success') task_id = resp.json['task_id'] self.assertTrue( wait_for_task(task_id, self.app)) common.compare_projects( 'basic_rename_llama', 'main', 'basic')
def test_undo_undoes_changes(self): self.proj.rename( self.task_state, 'Llama', 'basic/foo.py', 8).get() with self.assertRaises(ValueError): common.compare_projects( 'basic', 'main', 'basic') self.proj.undo().get() common.compare_projects( 'basic', 'main', 'basic')
def test_rename(self): rsp_data = json_request( url='http://{}:{}/refactor/rename'.format( self.host, self.port), data={ 'name': 'Llama', 'path': 'basic/foo.py', 'offset': 8, }) self.assertEqual(rsp_data['result'], 'success') task_id = rsp_data['task_id'] self.assertTrue( wait_for_task(task_id, self.host, self.port)) common.compare_projects( 'basic_rename_llama', 'main', 'basic')
def test_undo_undoes_changes(self): resp = self.app.post_json('/refactor/rename', { 'name': 'Llama', 'path': 'basic/foo.py', 'offset': 8, }) if resp.json['result'] != 'success': print(resp.json['message']) self.assertEqual(resp.json['result'], 'success') task_id = resp.json['task_id'] self.assertTrue(wait_for_task(task_id, self.app)) with self.assertRaises(ValueError): common.compare_projects('basic', 'main', 'basic') resp = self.app.post_json('/history/undo', {'index': 0}) self.assertEqual(resp.json['result'], 'success') common.compare_projects('basic', 'main', 'basic')
def test_simple(self): self.proj.rename(self.task_state, 'Llama', 'basic/foo.py', 8).get() common.compare_projects('basic_rename_llama', 'main', 'basic')