コード例 #1
0
ファイル: test_validators.py プロジェクト: gsoyka/troposphere
 def test_one_of(self):
     conds = ["Bilbo", "Frodo"]
     one_of("hobbits", {"first": "Bilbo"}, "first", conds)
     one_of("hobbits", {"first": "Frodo"}, "first", conds)
     one_of("hobbits", {"first": Ref(AWS_REGION)}, "first", conds)
     with self.assertRaises(ValueError):
         one_of("hobbits", {"first": "Gandalf"}, "first", conds)
         one_of("hobbits", {"first": "Gandalf"}, "second", conds)
コード例 #2
0
 def test_one_of(self):
     conds = ['Bilbo', 'Frodo']
     one_of('hobbits', {"first": "Bilbo"}, "first", conds)
     one_of('hobbits', {"first": "Frodo"}, "first", conds)
     with self.assertRaises(ValueError):
         one_of('hobbits', {"first": "Gandalf"}, "first", conds)
         one_of('hobbits', {"first": "Gandalf"}, "second", conds)
コード例 #3
0
ファイル: test_validators.py プロジェクト: cigan1/troposphere
 def test_one_of(self):
     conds = ['Bilbo', 'Frodo']
     one_of('hobbits', {"first": "Bilbo"}, "first", conds)
     one_of('hobbits', {"first": "Frodo"}, "first", conds)
     with self.assertRaises(ValueError):
         one_of('hobbits', {"first": "Gandalf"}, "first", conds)
         one_of('hobbits', {"first": "Gandalf"}, "second", conds)