コード例 #1
0
 def test_edit_without_editor_env_var(self):
     self.useFixture(fixtures.EnvironmentVariable('EDITOR'))
     with mock.patch('subprocess.call') as call_mock:
         self.assertFalse(create._edit_file('somepath'))
         call_mock.assert_not_called()
コード例 #2
0
ファイル: test_create.py プロジェクト: openstack/reno
 def test_edit_without_editor_env_var(self):
     self.useFixture(fixtures.EnvironmentVariable('EDITOR'))
     with mock.patch('subprocess.call') as call_mock:
         self.assertFalse(create._edit_file('somepath'))
         call_mock.assert_not_called()
コード例 #3
0
 def test_edit(self):
     self.useFixture(fixtures.EnvironmentVariable('EDITOR', 'myeditor'))
     with mock.patch('subprocess.call') as call_mock:
         self.assertTrue(create._edit_file('somepath'))
         call_mock.assert_called_once_with(['myeditor', 'somepath'])
コード例 #4
0
ファイル: test_create.py プロジェクト: openstack/reno
 def test_edit(self):
     self.useFixture(fixtures.EnvironmentVariable('EDITOR', 'myeditor'))
     with mock.patch('subprocess.call') as call_mock:
         self.assertTrue(create._edit_file('somepath'))
         call_mock.assert_called_once_with(['myeditor', 'somepath'])