summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-09-25 18:51:19 +0300
committerLars Wirzenius <liw@liw.fi>2016-09-25 18:51:19 +0300
commit05b15134b0eefbd5c8f363665ef4d61d1b4136fc (patch)
treeaf859866ef56ed35f0ffd57d89483b395ca3db79
parent55429a8a9fb0b0546e20f5f9a6abb719261c3bc1 (diff)
downloadserver-yarns-05b15134b0eefbd5c8f363665ef4d61d1b4136fc.tar.gz
Check that second match can be returned
-rw-r--r--yarnhelper_tests.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/yarnhelper_tests.py b/yarnhelper_tests.py
index 5c49901..d13abb8 100644
--- a/yarnhelper_tests.py
+++ b/yarnhelper_tests.py
@@ -29,7 +29,16 @@ class GetNextMatchTests(unittest.TestCase):
with self.assertRaises(yarnhelper.Error):
h.get_next_match()
- def test_returns_match_if_there(self):
+ def test_returns_first_match_if_there(self):
h = yarnhelper.YarnHelper()
h.set_environment({'MATCH_1': 'first'})
self.assertEqual(h.get_next_match(), 'first')
+
+ def test_returns_second_match_if_there(self):
+ h = yarnhelper.YarnHelper()
+ h.set_environment({
+ 'MATCH_1': 'first',
+ 'MATCH_2': 'second',
+ })
+ self.assertEqual(h.get_next_match(), 'first')
+ self.assertEqual(h.get_next_match(), 'second')