mirror of
				https://github.com/craigerl/aprsd.git
				synced 2025-11-03 21:20:23 -05:00 
			
		
		
		
	This patch includes lots of changes to tox environment for
automatically detecting pep8 failures, which can cause python2 vs
python3 failures after install.
The following tox commands have been added
tox -efmt-check  - This checks the python syntax and formatting
tox -efmt        - Automatically fixes python syntax formatting that
                   fmt-check complains about.
tox -etype-check - check on types
tox -elint       - flake8 run
This patch also changes where the default config file is located.
The new location is ~/.config/aprsd/aprsd.yml
You can now also specify a custom config file on the command line
with the -c or --config option as well.
		
	
			
		
			
				
	
	
		
			24 lines
		
	
	
		
			518 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			518 B
		
	
	
	
		
			Python
		
	
	
	
	
	
# -*- coding: utf-8 -*-
 | 
						|
import sys
 | 
						|
import unittest
 | 
						|
 | 
						|
import pytest
 | 
						|
 | 
						|
from aprsd import main
 | 
						|
 | 
						|
if sys.version_info >= (3, 2):
 | 
						|
    from unittest import mock
 | 
						|
else:
 | 
						|
    import mock
 | 
						|
 | 
						|
 | 
						|
class testMain(unittest.TestCase):
 | 
						|
    @mock.patch("aprsd.main._imap_connect")
 | 
						|
    @mock.patch("aprsd.main._smtp_connect")
 | 
						|
    def test_validate_email(self, imap_mock, smtp_mock):
 | 
						|
        """Test to make sure we fail."""
 | 
						|
        imap_mock.return_value = None
 | 
						|
        smtp_mock.return_value = {"smaiof": "fire"}
 | 
						|
 | 
						|
        main.validate_email()
 |