Permalink
Browse files

Add some paltry unit tests

  • Loading branch information...
1 parent 3a381d7 commit 57ef3f3e815d70732ddfac8f355307399dbd4b50 @richo committed Dec 29, 2012
Showing with 28 additions and 0 deletions.
  1. +5 −0 Makefile
  2. +14 −0 test/station_fixture.py
  3. +9 −0 test/test_station.py
View
@@ -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
@@ -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)
@@ -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.