def test_alias_contract(self): e1 = Emitter("d3rkrsqld9gmqf.cloudfront.net", method="get") t = Tracker(e1, namespace="cloudfront", encode_base64=False, app_id="AF003") try: t.track_self_describing_event("not-SelfDescribingJson") except Exception as e: self.assertIsInstance(e, ContractNotRespected)
def test_alias_contract(self): e1 = Emitter("d3rkrsqld9gmqf.cloudfront.net", method="get") t = Tracker(e1, namespace="cloudfront", encode_base64=False, app_id="AF003") try: t.track_self_describing_event("not-SelfDescribingJson") except Exception as e: self.assertIsInstance(e, ContractNotRespected)
def test_alias_of_track_unstruct_event(self, mok_track): mokEmitter = self.create_patch('snowplow_tracker.Emitter') e = mokEmitter() with ContractsDisabled(): mok_track.side_effect = mocked_track t = Tracker(e) evJson = SelfDescribingJson("test.schema", {"n": "v"}) # call the alias t.track_self_describing_event(evJson) self.assertEqual(mok_track.call_count, 1)