feat: Add tests for get_format_from_filename
This commit is contained in:
		
							
								
								
									
										0
									
								
								tests/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								tests/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										21
									
								
								tests/test_cli.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								tests/test_cli.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
from fediverse_blocklist_tool.cli import get_format_from_filename
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_get_format_from_filename():
 | 
			
		||||
    assert "toml" == get_format_from_filename("temp.toml")
 | 
			
		||||
    assert "csv" == get_format_from_filename("temp.csv")
 | 
			
		||||
    assert "json" == get_format_from_filename("temp.json")
 | 
			
		||||
    assert "md" == get_format_from_filename("temp.md")
 | 
			
		||||
 | 
			
		||||
    assert "md" == get_format_from_filename("csv.md")
 | 
			
		||||
    assert "md" == get_format_from_filename("toml.md")
 | 
			
		||||
    assert "md" == get_format_from_filename("json.md")
 | 
			
		||||
 | 
			
		||||
    assert "toml" == get_format_from_filename("csv.toml")
 | 
			
		||||
    assert "toml" == get_format_from_filename("md.toml")
 | 
			
		||||
    assert "toml" == get_format_from_filename("json.toml")
 | 
			
		||||
    assert "toml" == get_format_from_filename("tmp")
 | 
			
		||||
 | 
			
		||||
    assert "json" == get_format_from_filename("csv.json")
 | 
			
		||||
    assert "json" == get_format_from_filename("md.json")
 | 
			
		||||
    assert "json" == get_format_from_filename("toml.json")
 | 
			
		||||
		Reference in New Issue
	
	Block a user