@patch('os.path.isfile', MagicMock(return_value=True))
    def test_push_success(self):
        path = '/srv/salt/saltines'
        file_data = ''
        mock_buf_size = len(file_data)
        mock_id = 'You don\'t need to see his identification.'
        ret = True

        class MockChannel(object):
            @staticmethod
            def factory(__opts__):
                return MockChannel()

            def send(self, load):
                return 'channel info'

        class MockAuth(object):
            def gen_token(self, salt):
                return 'token info'

        def mock_auth_factory():
            return MockAuth()

        with patch('salt.transport.Channel', MockChannel):
            with patch('salt.modules.cp._auth', mock_auth_factory):
                with patch('salt.utils.fopen', mock_open(read_data=file_data)):
                    with patch.dict(cp.__opts__,
                                    {'file_buffer_size': mock_buf_size,
                                     'id': mock_id}):
                        self.assertEqual(cp.push(path), ret)
Email is sent if a valid email address is provided for password reset when a custom from_email is provided.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/cp_test.py/CpTestCase.test_push_success--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/contrib/auth/tests/test_views.py/PasswordResetTest.test_email_found_custom_from