Permalink
Browse files

Write a failing test that exposes the wont-update bug in the updater …

…graph
  • Loading branch information...
1 parent 17797c1 commit 34de87a23dd9ff69f1268926eef74593956a72e9 @batterseapower batterseapower committed Dec 6, 2009
Showing with 8 additions and 5 deletions.
  1. +8 −5 pinyin/tests/updatergraph.py
@@ -52,11 +52,14 @@ def testPreferUpdatersWhichUseChangedField(self):
]
for updaters in [short_chain_updaters, long_chain_updaters]:
- graph = filledgraphforupdaters(updaters, { "input one" : "", "input two" : "", "output" : "" }, { "input one" : "go" })
- yield assert_equal, graph["output"][1](), "from input one"
-
- graph = filledgraphforupdaters(updaters, { "input one" : "", "input two" : "", "output" : "" }, { "input two" : "go" })
- yield assert_equal, graph["output"][1](), "from input two"
+ for field, other_field in [("input one", "input two"), ("input two", "input one")]:
+ # Easy: other input is missing anyway
+ graph = filledgraphforupdaters(updaters, { field : "", other_field : "", "output" : "" }, { field : "go" })
+ yield assert_equal, graph["output"][1](), "from " + field
+
+ # Hard: other input is present
+ graph = filledgraphforupdaters(updaters, { field : "", other_field : "present!", "output" : "" }, { field : "go" })
+ yield assert_equal, graph["output"][1](), "from " + field
class TestUpdaterGraphUpdaters(unittest.TestCase):
def testEverythingEnglish(self):

0 comments on commit 34de87a

Please sign in to comment.