Exemple #1
0
    def test_afp_validation(self):

        funnel = 'test_funnel'
        step = 'test_step'
        goal = 'test_goal'

        # neither
        properties = {}
        self.assertRaises(tasks.InvalidFunnelProperties,
                          tasks._add_funnel_properties,
                          properties, funnel, step, goal)

        # only distinct
        properties = {'distinct_id': 'test_distinct_id'}
        fp = tasks._add_funnel_properties(properties, funnel, step, goal)

        # only ip
        properties = {'ip': 'some_ip'}
        self.assertRaises(tasks.InvalidFunnelProperties,
                          tasks._add_funnel_properties,
                          properties, funnel, step, goal)

        # both
        properties = {'distinct_id': 'test_distinct_id',
                      'ip': 'some_ip'}
        fp = tasks._add_funnel_properties(properties, funnel, step, goal)
Exemple #2
0
    def test_afp_validation(self):

        funnel = 'test_funnel'
        step = 'test_step'
        goal = 'test_goal'

        # neither
        properties = {}
        self.assertRaises(tasks.InvalidFunnelProperties,
                          tasks._add_funnel_properties, properties, funnel,
                          step, goal)

        # only distinct
        properties = {'distinct_id': 'test_distinct_id'}
        fp = tasks._add_funnel_properties(properties, funnel, step, goal)

        # only ip
        properties = {'ip': 'some_ip'}
        self.assertRaises(tasks.InvalidFunnelProperties,
                          tasks._add_funnel_properties, properties, funnel,
                          step, goal)

        # both
        properties = {'distinct_id': 'test_distinct_id', 'ip': 'some_ip'}
        fp = tasks._add_funnel_properties(properties, funnel, step, goal)
Exemple #3
0
    def test_afp_properties(self):

        funnel = 'test_funnel'
        step = 'test_step'
        goal = 'test_goal'

        properties = {'distinct_id': 'test_distinct_id'}

        funnel_properties = tasks._add_funnel_properties(properties, funnel,
                                                       step, goal)

        self.assertEqual(funnel_properties['funnel'], funnel)
        self.assertEqual(funnel_properties['step'], step)
        self.assertEqual(funnel_properties['goal'], goal)
Exemple #4
0
    def test_afp_properties(self):

        funnel = 'test_funnel'
        step = 'test_step'
        goal = 'test_goal'

        properties = {'distinct_id': 'test_distinct_id'}

        funnel_properties = tasks._add_funnel_properties(
            properties, funnel, step, goal)

        self.assertEqual(funnel_properties['funnel'], funnel)
        self.assertEqual(funnel_properties['step'], step)
        self.assertEqual(funnel_properties['goal'], goal)