Skip to content

Commit bb9f452

Browse files
committed
add unit test for license year
1 parent b980bfe commit bb9f452

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, os
2+
import datetime
23
from smtpapi import SMTPAPIHeader
34

45

@@ -72,6 +73,15 @@ def test_drop_empty(self):
7273
header.add_filter('testFilter', 'filter', 'filterValue')
7374
self.assertEqual(self.dropsHeader, json.loads(header.json_string()))
7475

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

7686
class TestRepository(unittest.TestCase):
7787

0 commit comments

Comments
 (0)