Пример #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
 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
 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'])