Skip to content

Commit 99ac5d8

Browse files
committed
a test
1 parent 969d699 commit 99ac5d8

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
.settings
44
.project
55
.pydevproject
6+
.coverage
7+
cover
68

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# TODO: maybe add all source files as dependeencies and so on...
2+
#
3+
all:
4+
@echo "nothing here yet"
5+
6+
test:
7+
nosetests -vvs --with-coverage --cover-html
8+
9+
clean:
10+
rm -rvf cover/
11+
12+
.PHONY: all test clean
13+

ttldict/test_ttldict.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Unit tests for TTLDict
3+
"""
4+
5+
from unittest import TestCase
6+
from ttldict import TTLDict
7+
8+
9+
class TTLDictTest(TestCase):
10+
""" TTLDict tests """
11+
def test_simple_no_ttl(self):
12+
""" Test simple usage """
13+
ttl_dict = TTLDict(None)
14+
orig_dict = {'hello': 'world', 'intval': 3}
15+
ttl_dict.update(orig_dict)
16+
self.assertEqual(sorted(orig_dict.items()), sorted(ttl_dict.items()))

0 commit comments

Comments
 (0)