Skip to content

Commit

Permalink
Add some paltry unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richo committed Dec 29, 2012
1 parent 3a381d7 commit 57ef3f3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Expand Up @@ -5,3 +5,8 @@ groundstation/proto/gizmo_pb2.py: groundstation/proto/gizmo.proto

clean:
find ./ -iname "*.pyc" -delete

_test:

test: _test
python -m unittest discover test
14 changes: 14 additions & 0 deletions test/station_fixture.py
@@ -0,0 +1,14 @@
import tempfile
import shutil
import unittest

from groundstation.node import Node
from groundstation.station import Station

class StationTestCase(unittest.TestCase):
def setUp(self):
self.node = Node()
self.station = Station(tempfile.mkdtemp(), self.node)

def tearDown(self):
shutil.rmtree(self.station.repo.path)
9 changes: 9 additions & 0 deletions test/test_station.py
@@ -0,0 +1,9 @@
from station_fixture import StationTestCase

class TestStationObjectCache(StationTestCase):
"""Proves that querying for an unknown object returns false, then true"""
def test_recently_queried(self):
self.assertFalse(self.station.recently_queried("rawrtest"))
self.assertTrue(self.station.recently_queried("rawrtest"))
self.assertFalse(self.station.recently_queried("rawrtestSomeOther"))

0 comments on commit 57ef3f3

Please sign in to comment.