Added some slightly better tests utilizing clirunner
This commit is contained in:
		
					parent
					
						
							
								e0c86483e4
							
						
					
				
			
			
				commit
				
					
						c7c40e1f7d
					
				
			
		
					 1 changed files with 16 additions and 6 deletions
				
			
		| 
						 | 
					@ -1,12 +1,22 @@
 | 
				
			||||||
import pytest
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
from task_status.task_status import main as task_main
 | 
					from task_status.task_status import main as task_main
 | 
				
			||||||
 | 
					from task_status.task_status import __version__ as task_version
 | 
				
			||||||
 | 
					from click.testing import CliRunner
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					runner = CliRunner()
 | 
				
			||||||
def test_task():
 | 
					 | 
				
			||||||
    assert True
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_main():
 | 
					def test_main():
 | 
				
			||||||
    if task_main:
 | 
					    if task_main:
 | 
				
			||||||
        assert True
 | 
					        response = runner.invoke(task_main)
 | 
				
			||||||
 | 
					        assert response.exit_code == 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_version():
 | 
				
			||||||
 | 
					    response = runner.invoke(task_main, ["--version"])
 | 
				
			||||||
 | 
					    assert response.exit_code == 0
 | 
				
			||||||
 | 
					    assert task_version in response.output
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_uuid():
 | 
				
			||||||
 | 
					    response = runner.invoke(task_main, ["--uuid"])
 | 
				
			||||||
 | 
					    assert response.exit_code == 0
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue