old_contents: """
  Tests for Marcher
  
  Erkki Mattila, 2014
  """
  
  import Image
  from marcher import Marcher
  
  def test():
  
      surrounded = Image.open("test_input/surrounded.bmp")
      surr_pix = surrounded.load()
  
      separate = Image.open("test_input/separate.bmp")
      sepa_pix = separate.load()
  
      joined = Image.open("test_input/joined.bmp")
      join_pix = joined.load()
  
      edges = Image.open("test_input/complex.bmp")
      edge_pix = edges.load()
  
      blue = (0,0,255)
      green = (0,255,0)
  
      colours = [blue, green]
  
      msurr = Marcher("test_input/surrounded.bmp")
      msepa = Marcher("test_input/separate.bmp")
      mjoin = Marcher("test_input/joined.bmp")
      medge = Marcher("test_input/complex.bmp")
  
      for colour in colours:
  
          msurr.colour = colour
          msepa.colour = colour
          mjoin.colour = colour
          medge.colour = colour
  
          sepa_points = msepa.do_march()
          surr_points = msurr.do_march()
          join_points = mjoin.do_march()
          edge_points = medge.do_march()
  
          for p in sepa_points:
              x = p[0]
              y = p[1]
              sepa_pix[x,y] = (255,0,0)
  
          for p in surr_points:
              x = p[0]
              y = p[1]
              surr_pix[x,y] = (255,0,0)
  
          for p in join_points:
              x = p[0]
              y = p[1]
              join_pix[x,y] = (255,0,0)
  
          for p in edge_points:
              x = p[0]
              y = p[1]
              edge_pix[x,y] = (175,175,175)
  
      separate.save("test_output/sepatest.bmp")
      surrounded.save("test_output/surrtest.bmp")
      joined.save("test_output/jointest.bmp")
      edges.save("test_output/edgetest.bmp")
      
  if __name__ == "__main__":
      print "Start tests"
      test()
      print "Tests have finished"
  
new_contents: """
  Tests for Marcher
  
  Erkki Mattila, 2014
  """
  
  import Image
  from marcher import Marcher
  
  def test():
  
      surrounded = Image.open("test_input/surrounded.bmp")
      surr_pix = surrounded.load()
  
      separate = Image.open("test_input/separate.bmp")
      sepa_pix = separate.load()
  
      joined = Image.open("test_input/joined.bmp")
      join_pix = joined.load()
  
      edges = Image.open("test_input/edges.bmp")
      edge_pix = edges.load()
  
      blue = (0,0,255)
      green = (0,255,0)
  
      colours = [blue, green]
  
      msurr = Marcher("test_input/surrounded.bmp")
      msepa = Marcher("test_input/separate.bmp")
      mjoin = Marcher("test_input/joined.bmp")
      medge = Marcher("test_input/edges.bmp")
  
      print "Start of surrounded.bmp"
      for colour in colours:
  
          msurr.colour = colour
          surr_points = msurr.do_march()
  
          for p in surr_points:
              x = p[0]
              y = p[1]
              surr_pix[x,y] = (255,0,0)
  
      surrounded.save("test_output/surrtest.bmp")
      print "surrounded.bmp complete"
  
      print "Start of separate.bmp"
      for colour in colours:
  
          msepa.colour = colour
          sepa_points = msepa.do_march()
          
          for p in sepa_points:
              x = p[0]
              y = p[1]
              sepa_pix[x,y] = (255,0,0)
  
      separate.save("test_output/sepatest.bmp")
      print "separate.bmp complete"
  
      print "Start of joined.bmp"
      for colour in colours:
  
          mjoin.colour = colour
          join_points = mjoin.do_march()
  
          for p in join_points:
              x = p[0]
              y = p[1]
              join_pix[x,y] = (255,0,0)
      
      joined.save("test_output/jointest.bmp")
      print "joined.bmp complete"
  
      "Start of edges.bmp"
      for colour in colours:
          
          medge.colour = colour
          edge_points = medge.do_march()
  
          for p in edge_points:
              x = p[0]
              y = p[1]
              edge_pix[x,y] = (175,175,175)
  
      edges.save("test_output/edgetest.bmp")
      print "edges.bmp complete"
  
  if __name__ == "__main__":
      print "Start tests"
      test()
      print "Tests have finished"
  
subject: Split tests to run separately