old_contents: import unittest
  
  from plyer.platforms.win import email
  from plyer.utils import platform
  
  
  class Test(unittest.TestCase):
      def test_email_win(self):
          if platform != 'win':
              return
  
          # replace os.startfile to compare final value
          _startfile = globals()['email'].__dict__['os'].startfile
  
          # instead of os.startfile create a variable to compare
          globals()['email'].__dict__['os'].startfile = lambda *args: setattr(
              self, 'mailto', args[0]
          )
  
          try:
              test_mailto = 'mailto:recipient?subject=subject&body=text'
              email.WindowsEmail().send(
                  recipient='recipient',
                  subject='subject',
                  text='text'
              )
              self.assertEqual(self.mailto, test_mailto)
          except WindowsError:
              # if WE is raised, email client isn't found,
              # but the platform code works correctly
              print('Mail client not found!')
  
          # give back startfile and remove mailto
          globals()['email'].__dict__['os'].startfile = _startfile
          del self.mailto
  
  
  if __name__ == '__main__':
      unittest.main()
  
new_contents: '''
  TestEmail
  =========
  
  Tested platforms:
  
  * Windows
  '''
  
  import unittest
  
  from mock import Mock, patch
  from plyer.tests.common import PlatformTest, platform_import
  
  
  class TestEmail(unittest.TestCase):
      '''
      TestCase for plyer.email.
      '''
  
      @staticmethod
      @PlatformTest('win')
      def test_email_win():
          '''
          Test starting Windows email client for plyer.email.
          '''
          email = platform_import(
              platform='win',
              module_name='email'
          )
  
          try:
              test_mailto = 'mailto:recipient?subject=subject&body=text'
              with patch(target='os.startfile', new=Mock()) as startfile:
                  email.instance().send(
                      recipient='recipient',
                      subject='subject',
                      text='text'
                  )
              startfile.assert_called_once_with(test_mailto)
          except WindowsError:  # pylint: disable=undefined-variable
              # if WE is raised, email client isn't found,
              # but the platform code works correctly
              print('Mail client not found!')
  
  
  if __name__ == '__main__':
      unittest.main()
  
subject: Fix test for WindowsEmail