def test_clone_raises_exception(self, mock_exit): instance = BaseVCS('git+/foo/bar') with self.assertRaises(FacioException): instance.clone() self.mocked_facio_exceptions_puts.assert_any_call( 'Error: The clone method on BaseVCS needs to be overridden.')
def test_rm_temp_dir(self): instance = BaseVCS('git+/foo/bar') d = instance.get_temp_directory() instance.remove_tmp_dir(d, '/foo/bar') self.assertFalse(os.path.isdir(d))
def test_get_temp_directory(self, mock_tempfile): instance = BaseVCS('git+/foo/bar') path = instance.get_temp_directory() mock_tempfile.return_value = '/tmp/bar' mock_tempfile.assert_called_with(suffix='facio') self.assertEqual(path, instance.get_temp_directory())
def test_repository_path(self): instance = BaseVCS('git+/foo/+bar') self.assertEqual(instance.path, '/foo/+bar') self.assertEqual(instance.vcs, 'git')