test: handle literal string
Tuple are used for literal strings (see RFC3501 Section 4.3). Signed-off-by: Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
		
				
					committed by
					
						
						Nicolas Sebrecht
					
				
			
			
				
	
			
			
			
						parent
						
							4a5f32febd
						
					
				
				
					commit
					ecc2af9f99
				
			@@ -148,12 +148,16 @@ class OLITestLib():
 | 
				
			|||||||
            assert res_t == 'OK'
 | 
					            assert res_t == 'OK'
 | 
				
			||||||
            dirs = []
 | 
					            dirs = []
 | 
				
			||||||
            for d in data:
 | 
					            for d in data:
 | 
				
			||||||
                m = re.search(br'''
 | 
					                if isinstance(d, tuple):
 | 
				
			||||||
                    ("                      # starting quote
 | 
					                    # literal (unquoted)
 | 
				
			||||||
                    ([^"]|\\")*             # a non-quote or a backslashded quote
 | 
					                    folder = b'"%s"' % d[1].replace('"', '\\"')
 | 
				
			||||||
                    ")$                     # ending quote
 | 
					                else:
 | 
				
			||||||
                    ''', d, flags=re.VERBOSE)
 | 
					                    m = re.search(br'''
 | 
				
			||||||
                folder = bytearray(m.group(1))
 | 
					                        ("                      # starting quote
 | 
				
			||||||
 | 
					                        ([^"]|\\")*             # a non-quote or a backslashded quote
 | 
				
			||||||
 | 
					                        ")$                     # ending quote
 | 
				
			||||||
 | 
					                        ''', d, flags=re.VERBOSE)
 | 
				
			||||||
 | 
					                    folder = bytearray(m.group(1))
 | 
				
			||||||
                #folder = folder.replace(br'\"', b'"') # remove quoting
 | 
					                #folder = folder.replace(br'\"', b'"') # remove quoting
 | 
				
			||||||
                dirs.append(folder)
 | 
					                dirs.append(folder)
 | 
				
			||||||
            # 2) filter out those not starting with INBOX.OLItest and del...
 | 
					            # 2) filter out those not starting with INBOX.OLItest and del...
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user