def test_parse(self): self.assertEqual(QueryFilter.parse([]), []) x = QueryFilter.parse([{"instance-state-name": "running"}]) self.assertEqual( x[0].query(), {"Name": "instance-state-name", "Values": ["running"]} ) self.assertTrue( isinstance(QueryFilter.parse([{"tag:ASV": "REALTIMEMSG"}])[0], QueryFilter) ) self.assertRaises(PolicyValidationError, QueryFilter.parse, [{"tag:ASV": None}])
def test_parse(self): self.assertEqual(QueryFilter.parse([]), []) x = QueryFilter.parse([{'instance-state-name': 'running'}]) self.assertEqual(x[0].query(), { 'Name': 'instance-state-name', 'Values': ['running'] }) self.assertTrue( isinstance( QueryFilter.parse([{ 'tag:ASV': 'REALTIMEMSG' }])[0], QueryFilter)) self.assertRaises(ValueError, QueryFilter.parse, [{'tag:ASV': None}])
def test_parse(self): self.assertEqual(QueryFilter.parse([]), []) x = QueryFilter.parse( [{'instance-state-name': 'running'}]) self.assertEqual( x[0].query(), {'Name': 'instance-state-name', 'Values': ['running']}) self.assertTrue( isinstance( QueryFilter.parse( [{'tag:ASV': 'REALTIMEMSG'}])[0], QueryFilter)) self.assertRaises( ValueError, QueryFilter.parse, [{'tag:ASV': None}])