mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-30 22:54:14 +00:00 
			
		
		
		
	
				
					committed by
					
						 Vladimir Iakovlev
						Vladimir Iakovlev
					
				
			
			
				
	
			
			
			
						parent
						
							59dc6cbf90
						
					
				
				
					commit
					48e1e4217f
				
			
							
								
								
									
										25
									
								
								tests/rules/test_nixos_cmd_not_found.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								tests/rules/test_nixos_cmd_not_found.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| import pytest | ||||
| from thefuck.rules.nixos_cmd_not_found import match, get_new_command | ||||
| from thefuck.types import Command | ||||
|  | ||||
|  | ||||
| @pytest.mark.parametrize('command', [ | ||||
|     Command('vim', 'nix-env -iA nixos.vim')]) | ||||
| def test_match(mocker, command): | ||||
|     mocker.patch('thefuck.rules.nixos_cmd_not_found', return_value=None) | ||||
|     assert match(command) | ||||
|  | ||||
|  | ||||
| @pytest.mark.parametrize('command', [ | ||||
|     Command('vim', ''), | ||||
|     Command('', '')]) | ||||
| def test_not_match(mocker, command): | ||||
|     mocker.patch('thefuck.rules.nixos_cmd_not_found', return_value=None) | ||||
|     assert not match(command) | ||||
|  | ||||
|  | ||||
| @pytest.mark.parametrize('command, new_command', [ | ||||
|     (Command('vim', 'nix-env -iA nixos.vim'), 'nix-env -iA nixos.vim && vim'), | ||||
|     (Command('pacman', 'nix-env -iA nixos.pacman'), 'nix-env -iA nixos.pacman && pacman')]) | ||||
| def test_get_new_command(mocker, command, new_command): | ||||
|     assert get_new_command(command) == new_command | ||||
		Reference in New Issue
	
	Block a user