import os
import time

try:
    import unittest2 as unittest
except ImportError:
    import unittest

class DateRangeTest(unittest.TestCase):
    def setUp(self):
        self.openlicensefile = os.path.join(os.path.dirname(__file__), '../LICENSE.txt')
        self.pattern = 'Copyright (c) 2012 - %s SendGrid, Inc.' % (time.strftime("%Y"))
        self.licensefile = open(self.openlicensefile).read()

    def test__daterange(self):
        self.assertTrue(self.pattern in self.licensefile)

import os
import time

try:
    import unittest2 as unittest
except ImportError:
    import unittest


class DateRangeTest(unittest.TestCase):
    def setUp(self):
        self.openlicensefile = os.path.join(
                                os.path.dirname(__file__),
                                '../LICENSE.txt')
        self.pattern = 'Copyright (c) 2012 - %s SendGrid, Inc.' % (
                        time.strftime("%Y"))
        self.licensefile = open(self.openlicensefile).read()

    def test__daterange(self):
        self.assertTrue(self.pattern in self.licensefile)

Update code for PEP8 compliance
Update code for PEP8 compliance

  import os
  import time
  
  try:
      import unittest2 as unittest
  except ImportError:
      import unittest
  
+ 
  class DateRangeTest(unittest.TestCase):
      def setUp(self):
-         self.openlicensefile = os.path.join(os.path.dirname(__file__), '../LICENSE.txt')
+         self.openlicensefile = os.path.join(
+                                 os.path.dirname(__file__),
+                                 '../LICENSE.txt')
-         self.pattern = 'Copyright (c) 2012 - %s SendGrid, Inc.' % (time.strftime("%Y"))
+         self.pattern = 'Copyright (c) 2012 - %s SendGrid, Inc.' % (
+                         time.strftime("%Y"))
          self.licensefile = open(self.openlicensefile).read()
  
      def test__daterange(self):
          self.assertTrue(self.pattern in self.licensefile)
  
Update code for PEP8 compliance
## Code Before:
import os
import time

try:
    import unittest2 as unittest
except ImportError:
    import unittest

class DateRangeTest(unittest.TestCase):
    def setUp(self):
        self.openlicensefile = os.path.join(os.path.dirname(__file__), '../LICENSE.txt')
        self.pattern = 'Copyright (c) 2012 - %s SendGrid, Inc.' % (time.strftime("%Y"))
        self.licensefile = open(self.openlicensefile).read()

    def test__daterange(self):
        self.assertTrue(self.pattern in self.licensefile)

## Instruction:
Update code for PEP8 compliance
## Code After:
import os
import time

try:
    import unittest2 as unittest
except ImportError:
    import unittest


class DateRangeTest(unittest.TestCase):
    def setUp(self):
        self.openlicensefile = os.path.join(
                                os.path.dirname(__file__),
                                '../LICENSE.txt')
        self.pattern = 'Copyright (c) 2012 - %s SendGrid, Inc.' % (
                        time.strftime("%Y"))
        self.licensefile = open(self.openlicensefile).read()

    def test__daterange(self):
        self.assertTrue(self.pattern in self.licensefile)
