示例#1
0
 def test_query_invalid_4(self):
     query = "length([?contains('id', 'Publishers'])"
     with self.assertRaises(ValueError):
         jmespath_type(query)
示例#2
0
 def test_query_invalid_2(self):
     query = '[?name=My Resource Group]'
     with self.assertRaises(ValueError):
         jmespath_type(query)
示例#3
0
 def test_query_invalid_3(self):
     query = "[].location='westus'"
     with self.assertRaises(ValueError):
         jmespath_type(query)
示例#4
0
 def test_query_invalid_1(self):
     query = '[?asdf=asdf]'
     with self.assertRaises(ValueError):
         jmespath_type(query)
示例#5
0
 def test_query_unbalanced(self):
     query = 'length(@'
     with self.assertRaises(ValueError):
         jmespath_type(query)
示例#6
0
 def test_query_empty(self):
     query = ''
     with self.assertRaises(ValueError):
         jmespath_type(query)
示例#7
0
 def test_query_valid_2(self): # pylint: disable=no-self-use
     query = "[?storageProfile.osDisk.osType=='Linux'].[resourceGroup,name]"
     # Should not raise any exception as it is valid
     jmespath_type(query)
示例#8
0
 def test_query_valid_1(self): # pylint: disable=no-self-use
     query = 'length(@)'
     # Should not raise any exception as it is valid
     jmespath_type(query)