33import responses
44
55from securenative .api_manager import ApiManager
6- from securenative .config .configuration_manager import ConfigurationManager
6+ from securenative .config .securenative_options import SecureNativeOptions
77from securenative .context .securenative_context import SecureNativeContext
88from securenative .enums .event_types import EventTypes
99from securenative .enums .risk_level import RiskLevel
@@ -28,11 +28,8 @@ def setUp(self):
2828
2929 @responses .activate
3030 def test_track_event (self ):
31- options = ConfigurationManager .config_builder (). \
32- with_api_key ("YOUR_API_KEY" ). \
33- with_auto_send (True ). \
34- with_interval (10 ). \
35- with_api_url ("https://api.securenative-stg.com/collector/api/v1" )
31+ options = SecureNativeOptions (api_key = "YOUR_API_KEY" , auto_send = True , interval = 10 ,
32+ api_url = "https://api.securenative-stg.com/collector/api/v1" )
3633
3734 expected = "{\" eventType\" :\" sn.user.login\" ,\" userId\" :\" USER_ID\" ,\" userTraits\" :{" \
3835 "\" name\" :\" USER_NAME\" ,\" email\" :\" USER_EMAIL\" ,\" createdAt\" :null},\" request\" :{" \
@@ -54,11 +51,8 @@ def test_track_event(self):
5451
5552 @responses .activate
5653 def test_securenative_invalid_options_exception (self ):
57- options = ConfigurationManager .config_builder (). \
58- with_api_key ("YOUR_API_KEY" ). \
59- with_auto_send (True ). \
60- with_interval (10 ). \
61- with_api_url ("https://api.securenative-stg.com/collector/api/v1" )
54+ options = SecureNativeOptions (api_key = "YOUR_API_KEY" , auto_send = True , interval = 10 ,
55+ api_url = "https://api.securenative-stg.com/collector/api/v1" )
6256
6357 properties = {}
6458 for i in range (1 , 12 ):
@@ -78,9 +72,8 @@ def test_securenative_invalid_options_exception(self):
7872
7973 @responses .activate
8074 def test_verify_event (self ):
81- options = ConfigurationManager .config_builder (). \
82- with_api_key ("YOUR_API_KEY" ). \
83- with_api_url ("https://api.securenative-stg.com/collector/api/v1" )
75+ options = SecureNativeOptions (api_key = "YOUR_API_KEY" ,
76+ api_url = "https://api.securenative-stg.com/collector/api/v1" )
8477
8578 responses .add (responses .POST , "https://api.securenative-stg.com/collector/api/v1/verify" ,
8679 json = {
0 commit comments