More tests

This commit is contained in:
JP White 2021-05-13 13:42:09 -04:00
parent 694fc2a8ca
commit 7d4643033d
2 changed files with 35 additions and 0 deletions

13
tests/test_gravatar.py Normal file
View file

@ -0,0 +1,13 @@
import unittest
from gitinspector import gravatar
TEST_STRING = 'arbitrary'
class TestGravatar(unittest.TestCase):
def test_get_url(self):
expected_url = 'https://www.gravatar.com/avatar/c181b12d45d1fd849f885221f3ee3f39?default=identicon'
arbitrary_email = TEST_STRING + '@example.com'
actual_url = gravatar.get_url(arbitrary_email)
self.assertEqual(expected_url, actual_url)

22
tests/test_interval.py Normal file
View file

@ -0,0 +1,22 @@
import unittest
from gitinspector import interval
TEST_STRING = 'arbitrary'
class TestInterval(unittest.TestCase):
def test_has_interval(self):
actual = interval.has_interval()
self.assertFalse(actual)
def test_get_since(self):
expected = ''
actual = interval.get_since()
self.assertEqual(expected, actual)
def test_set_since(self):
expected = '--since=' + TEST_STRING
interval.set_since(TEST_STRING)
actual = interval.get_since()
self.assertEqual(expected, actual)