11import configparser
22import os
3+ import platform
34import unittest
45
56from securenative .config .configuration_manager import ConfigurationManager
@@ -27,6 +28,7 @@ def create_ini_file(self, conf):
2728 with open (self .config_file_path , "w" ) as configfile :
2829 config .write (configfile )
2930
31+ @unittest .skipIf (platform .system () == "Windows" or platform .system () == "windows" , "test not supported on windows" )
3032 def test_parse_config_file_correctly (self ):
3133 try :
3234 os .remove (self .config_file_path )
@@ -72,6 +74,7 @@ def test_parse_config_file_correctly(self):
7274 self .assertEqual (options .max_events , "100" )
7375 self .assertEqual (options .timeout , "1500" )
7476
77+ @unittest .skipIf (platform .system () == "Windows" or platform .system () == "windows" , "test not supported on windows" )
7578 def test_ignore_unknown_config_in_properties_file (self ):
7679 try :
7780 os .remove (self .config_file_path )
@@ -100,6 +103,7 @@ def test_ignore_unknown_config_in_properties_file(self):
100103 self .assertIsNotNone (options )
101104 self .assertEqual (options .timeout , "1500" )
102105
106+ @unittest .skipIf (platform .system () == "Windows" or platform .system () == "windows" , "test not supported on windows" )
103107 def test_handle_invalid_config_file (self ):
104108 try :
105109 os .remove (self .config_file_path )
@@ -124,6 +128,7 @@ def test_handle_invalid_config_file(self):
124128
125129 self .assertIsNotNone (options )
126130
131+ @unittest .skipIf (platform .system () == "Windows" or platform .system () == "windows" , "test not supported on windows" )
127132 def ignore_invalid_config_file_entries (self ):
128133 try :
129134 os .remove (self .config_file_path )
@@ -154,6 +159,7 @@ def ignore_invalid_config_file_entries(self):
154159 self .assertIsNotNone (options )
155160 self .assertEqual (options .fail_over_strategy , FailOverStrategy .FAIL_OPEN )
156161
162+ @unittest .skipIf (platform .system () == "Windows" or platform .system () == "windows" , "test not supported on windows" )
157163 def test_load_default_config (self ):
158164 try :
159165 os .remove (self .config_file_path )
@@ -184,6 +190,7 @@ def test_load_default_config(self):
184190 self .assertEqual (options .log_level , "CRITICAL" )
185191 self .assertEqual (options .fail_over_strategy , FailOverStrategy .FAIL_OPEN .value )
186192
193+ @unittest .skipIf (platform .system () == "Windows" or platform .system () == "windows" , "test not supported on windows" )
187194 def test_get_config_from_env_variables (self ):
188195 try :
189196 os .remove (self .config_file_path )
@@ -223,6 +230,7 @@ def test_get_config_from_env_variables(self):
223230 self .assertEqual (options .log_level , "Debug" )
224231 self .assertEqual (options .fail_over_strategy , FailOverStrategy .FAIL_CLOSED .value )
225232
233+ @unittest .skipIf (platform .system () == "Windows" or platform .system () == "windows" , "test not supported on windows" )
226234 def test_default_values_for_invalid_enum_config_props (self ):
227235 try :
228236 os .remove (self .config_file_path )
0 commit comments