add: tests
This commit is contained in:
		
							parent
							
								
									760cec9a20
								
							
						
					
					
						commit
						865caa627e
					
				
					 15 changed files with 558 additions and 386 deletions
				
			
		| 
						 | 
				
			
			@ -27,14 +27,18 @@ def check_id(response, id):
 | 
			
		|||
def check_name(response, name):
 | 
			
		||||
    assert response.json().get("name") == name, "controller name check failed"
 | 
			
		||||
 | 
			
		||||
def check_ip(response, ip):
 | 
			
		||||
    assert response.json().get("ip") == ip, "controller ip check failed"
 | 
			
		||||
 | 
			
		||||
def find(response, id=None, name=None):
 | 
			
		||||
    print(response.json())
 | 
			
		||||
    for controller in response.json():
 | 
			
		||||
        if id != None and id != schedule.get("id"):
 | 
			
		||||
            print(schedule.get("id"))
 | 
			
		||||
        if id != None and id != controller.get("id"):
 | 
			
		||||
            print(controller.get("id"))
 | 
			
		||||
            continue
 | 
			
		||||
 | 
			
		||||
        if name != None and name != schedule.get("name"):
 | 
			
		||||
            print(schedule.get("name"))
 | 
			
		||||
        if name != None and name != controller.get("name"):
 | 
			
		||||
            print(controller.get("name"))
 | 
			
		||||
            continue
 | 
			
		||||
        return
 | 
			
		||||
    assert False, "controller not found in list"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue