Skip to content

Commit eb3eb29

Browse files
committed
add unit test for license year
1 parent 594131e commit eb3eb29

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unittest, json, decimal
2+
import datetime
23
from smtpapi import SMTPAPIHeader
34

45
class TestSMTPAPI(unittest.TestCase):
@@ -71,6 +72,15 @@ def test_drop_empty(self):
7172
header.add_filter('testFilter', 'filter', 'filterValue')
7273
self.assertEqual(self.dropsHeader, json.loads(header.json_string()))
7374

75+
def test_license_year(self):
76+
LICENSE_FILE = 'LICENSE.txt'
77+
copyright_line = ''
78+
with open(LICENSE_FILE, 'r') as f:
79+
for line in f:
80+
if line.startswith('Copyright'):
81+
copyright_line = line.strip()
82+
break
83+
self.assertEqual('Copyright (c) 2013-%s SendGrid, Inc.' % datetime.datetime.now().year, copyright_line)
7484

7585
if __name__ == '__main__':
7686
unittest.main()

0 commit comments

Comments
 (0)