Skip to content

Commit 8977c4e

Browse files
committed
Merge branch 'add-tests' of github.com:PostHog/posthog-python into add-tests
2 parents 710ac05 + 678e4ac commit 8977c4e

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,5 @@ jobs:
2323
python -m pip install -e .
2424
2525
- name: Run posthog tests
26-
env:
27-
SECRET_KEY: '6b01eee4f945ca25045b5aab440b953461faf08693a9abbf1166dc7c6b9772da' # unsafe - for testing only
28-
DATABASE_URL: 'postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres'
2926
run: |
3027
python setup.py test
31-
- name: Run EE tests
32-
env:
33-
SECRET_KEY: '6b01eee4f945ca25045b5aab440b953461faf08693a9abbf1166dc7c6b9772da' # unsafe - for testing only
34-
DATABASE_URL: 'postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres'
35-
PRIMARY_DB: 'clickhouse'
36-
CLICKHOUSE_HOST: 'localhost'
37-
CLICKHOUSE_DATABASE: 'posthog_test'
38-
CLICKHOUSE_SECURE: 'False'
39-
CLICKHOUSE_VERIFY: 'False'
40-
run: |
41-
mkdir -p frontend/dist
42-
touch frontend/dist/index.html
43-
touch frontend/dist/layout.html
44-
touch frontend/dist/shared_dashboard.html
45-
python manage.py test ee --testrunner="ee.clickhouse.clickhouse_test_runner.ClickhouseTestRunner"

posthog/test/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TestClient(unittest.TestCase):
1212

1313
def fail(self, e, batch):
1414
"""Mark the failure handler"""
15-
print('FAILL', e, batch)
15+
print('FAIL', e, batch)
1616
self.failed = True
1717

1818
def setUp(self):
@@ -76,7 +76,7 @@ def test_basic_identify(self):
7676
self.assertTrue(success)
7777
self.assertFalse(self.failed)
7878

79-
self.assertEqual(msg['$set'], {'trait': 'value'})
79+
self.assertEqual(msg['$set']['trait'], 'value')
8080
self.assertTrue(isinstance(msg['timestamp'], str))
8181
self.assertTrue(isinstance(msg['messageId'], str))
8282
self.assertEqual(msg['distinct_id'], 'distinct_id')
@@ -91,7 +91,7 @@ def test_advanced_identify(self):
9191

9292
self.assertEqual(msg['timestamp'], '2014-09-03T00:00:00+00:00')
9393
self.assertEqual(msg['context']['ip'], '192.168.0.1')
94-
self.assertEqual(msg['$set'], {'trait': 'value'})
94+
self.assertEqual(msg['$set']['trait'], 'value')
9595
self.assertEqual(msg['properties']['$lib'], 'posthog-python')
9696
self.assertEqual(msg['properties']['$lib_version'], VERSION)
9797
self.assertTrue(isinstance(msg['timestamp'], str))

0 commit comments

Comments
 (0)