MCPcopy
hub / github.com/PostHog/posthog / test_paths_in_window

Method test_paths_in_window

posthog/queries/test/test_paths.py:436–473  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

434 self.assertTrue(response[2].items() >= {"source": "2_/pricing", "target": "3_/about", "value": 1}.items())
435
436 def test_paths_in_window(self):
437 _create_person(team_id=self.team.pk, distinct_ids=["person_1"])
438
439 _create_event(
440 properties={"$current_url": "/"},
441 distinct_id="person_1",
442 event="$pageview",
443 team=self.team,
444 timestamp="2020-04-14 03:25:34",
445 ),
446 _create_event(
447 properties={"$current_url": "/about"},
448 distinct_id="person_1",
449 event="$pageview",
450 team=self.team,
451 timestamp="2020-04-14 03:30:34",
452 ),
453 _create_event(
454 properties={"$current_url": "/"},
455 distinct_id="person_1",
456 event="$pageview",
457 team=self.team,
458 timestamp="2020-04-15 03:25:34",
459 ),
460 _create_event(
461 properties={"$current_url": "/about"},
462 distinct_id="person_1",
463 event="$pageview",
464 team=self.team,
465 timestamp="2020-04-15 03:30:34",
466 ),
467
468 filter = PathFilter(data={"date_from": "2020-04-13"})
469 response = paths(team=self.team, filter=filter).run(team=self.team, filter=filter)
470
471 self.assertEqual(response[0]["source"], "1_/")
472 self.assertEqual(response[0]["target"], "2_/about")
473 self.assertEqual(response[0]["value"], 2)
474
475 return TestPaths
476

Callers

nothing calls this directly

Calls 4

_create_personFunction · 0.90
_create_eventFunction · 0.90
PathFilterClass · 0.90
runMethod · 0.45

Tested by

no test coverage detected