Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/p/o/portfoliyo-HEAD/portfoliyo/tests/test_mixpanel.py   portfoliyo(Download)
        with mock.patch('portfoliyo.mixpanel.settings') as mock_settings:
            mock_settings.MIXPANEL_ID = 'mixpanel-token'
            mixpanel.track('some-event', {'property': 'value'})
 
    expected_data = {
def test_not_configured():
    """If mixpanel is not configured, no request is sent."""
    with mock.patch('portfoliyo.mixpanel.urllib2.urlopen') as mock_urlopen:
        with mock.patch('portfoliyo.mixpanel.settings', spec=[]):
            mixpanel.track('some-event', {'property': 'value'})
            mock_settings.MIXPANEL_ID = 'mptok'
            with mock.patch('portfoliyo.mixpanel.logger') as mock_logger:
                mixpanel.track('some-event')
 
 
            mock_settings.MIXPANEL_ID = 'mptok'
            with mock.patch('portfoliyo.mixpanel.logger') as mock_logger:
                mixpanel.track('some-event')