Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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'])
Exemplo n.º 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'])