old_contents: from mock import patch
  from mock import Mock
  from greengraph import Map
  import requests
  from matplotlib import image as img
  from StringIO import StringIO
  import numpy as np
  
  base="http://maps.googleapis.com/maps/api/staticmap?"
  
  [lat, long] = [51.0, 0.0]
  patch_get = Mock()
  patch_get.content = ''
  
  [left,bottom,right,top] = [10,10,60,60]
  
  def green_box(left,bottom,right,top):
      image_array = np.zeros([400,400,3])
      image_array[:,:,:] = 1
      image_array[left:right,bottom:top,0] = 0
      image_array[left:right,bottom:top,2] = 0
      return image_array
  
  #image_array = img.imread('image.png')
  image_array = green_box(left,bottom,right,top)
  patch_imread = Mock(return_value=image_array)
  
  with patch.object(requests,'get',patch_get) as mock_get:
      with patch.object(img,'imread',patch_imread) as mock_imread:
          my_map = Map(lat, long)
  
  mock_get.assert_called_with(
          "http://maps.googleapis.com/maps/api/staticmap?",
          params={
              'sensor':'false',
              'zoom':10,
              'size':'400x400',
              'center':'51.0,0.0',
              'style':'feature:all|element:labels|visibility:off',
              'maptype':'satellite'
          }
      )
  
  assert my_map.count_green() == 2500
  
new_contents: from mock import patch
  from mock import Mock
  from greengraph import Map
  import requests
  from matplotlib import image as img
  from StringIO import StringIO
  import numpy as np
  
  base="http://maps.googleapis.com/maps/api/staticmap?"
  
  [lat, long] = [51.0, 0.0]
  patch_get = Mock()
  patch_get.content = ''
  
  [left,bottom,right,top] = [10,10,60,60]
  
  def green_box(left,bottom,right,top):
      image_array = np.zeros([400,400,3])
      image_array[:,:,:] = 1
      image_array[left:right,bottom:top,0] = 0
      image_array[left:right,bottom:top,2] = 0
      return image_array
  
  def box_count(left,bottom,right,top):
      return abs(right-left)*abs(top-bottom)
  
  #image_array = img.imread('image.png')
  image_array = green_box(left,bottom,right,top)
  patch_imread = Mock(return_value=image_array)
  
  with patch.object(requests,'get',patch_get) as mock_get:
      with patch.object(img,'imread',patch_imread) as mock_imread:
          my_map = Map(lat, long)
  
  mock_get.assert_called_with(
          "http://maps.googleapis.com/maps/api/staticmap?",
          params={
              'sensor':'false',
              'zoom':10,
              'size':'400x400',
              'center':'51.0,0.0',
              'style':'feature:all|element:labels|visibility:off',
              'maptype':'satellite'
          }
      )
  
  assert my_map.count_green() == 2500
  
subject: Include box_count function to count the number of pixels in a box.