From bb9f452697e7a035876ed69e1c5f5d86bde5ed4b Mon Sep 17 00:00:00 2001 From: pushkyn Date: Mon, 30 Oct 2017 00:13:19 +0300 Subject: [PATCH] add unit test for license year --- test/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/__init__.py b/test/__init__.py index 53db34a..85d269f 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,4 +1,5 @@ import unittest, json, decimal, os +import datetime from smtpapi import SMTPAPIHeader @@ -72,6 +73,15 @@ def test_drop_empty(self): header.add_filter('testFilter', 'filter', 'filterValue') self.assertEqual(self.dropsHeader, json.loads(header.json_string())) + def test_license_year(self): + LICENSE_FILE = 'LICENSE.txt' + copyright_line = '' + with open(LICENSE_FILE, 'r') as f: + for line in f: + if line.startswith('Copyright'): + copyright_line = line.strip() + break + self.assertEqual('Copyright (c) 2013-%s SendGrid, Inc.' % datetime.datetime.now().year, copyright_line) class TestRepository(unittest.TestCase):