old_contents: # -*- coding: utf-8 -*-
  
  """
  Copyright [2009-2017] EMBL-European Bioinformatics Institute
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  """
  
  
  import tempfile
  
  import pytest
  
  
  @pytest.mark.parameterize('filename', [
      'ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/_README.TXT',
      'http://www.google.com',
      'readme.md',
  ])
  def test_can_copy_a_over(filename):
      with tempfile.NamedTemporaryFile() as tmp:
          fetch(filename, tmp.name)
          tmp.seek(0)
          assert tmp.read()
  
  
  @pytest.mark.skip
  def test_can_copy_a_file_into_a_directory():
      pass
  
  
  @pytest.mark.skip
  def test_can_copy_a_directory(dirname):
      pass
  
  
  @pytest.mark.skip
  def test_copies_a_directory_into_another_directory():
      pass
  
  
  @pytest.mark.skip
  @pytest.mark.parameterize('filename', [
      'ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/not-here.TXT'
      'a-path-that-does-not-exist/yup',
  ])
  def test_complains_given_bad_locations(location):
      filename = 'should-never-exist'
      with pytest.raises(Exception):
          fetch(location, filename)
  
      assert not os.path.exists(filename)
  
new_contents: # -*- coding: utf-8 -*-
  
  """
  Copyright [2009-2017] EMBL-European Bioinformatics Institute
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  """
  
  
  import os
  import tempfile
  
  import pytest
  
  from tasks.utils.fetch import fetch
  
  
  @pytest.mark.parametrize('filename', [
      'ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/_README.TXT',
      'http://www.google.com',
      'readme.md',
  ])
  def test_can_copy_a_over(filename):
      with tempfile.NamedTemporaryFile() as tmp:
          fetch(filename, tmp.name)
          tmp.flush()
          with open(tmp.name, 'r') as t2:
              assert t2.read()
  
  
  @pytest.mark.skip
  def test_can_copy_a_file_into_a_directory():
      pass
  
  
  @pytest.mark.skip
  def test_can_copy_a_directory(dirname):
      pass
  
  
  @pytest.mark.skip
  def test_copies_a_directory_into_another_directory():
      pass
  
  
  @pytest.mark.skip
  @pytest.mark.parametrize('location', [
      'ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/not-here.TXT'
      'a-path-that-does-not-exist/yup',
  ])
  def test_complains_given_bad_locations(location):
      filename = 'should-never-exist'
      with pytest.raises(Exception):
          fetch(location, filename)
  
      assert not os.path.exists(filename)
  
subject: Fix failing tests