1+ import importlib .util
12import os
2- import sys
33import unittest
44from unittest .mock import patch
5- import importlib .util
65
76# Get the path to config.py directly
8- config_path = os .path .join (os .path .dirname (os .path .dirname (os .path .dirname (__file__ ))), ' roboflow' , ' config.py' )
7+ config_path = os .path .join (os .path .dirname (os .path .dirname (os .path .dirname (__file__ ))), " roboflow" , " config.py" )
98
109
1110class TestClassSorting (unittest .TestCase ):
@@ -17,7 +16,7 @@ def test_disable_class_sorting_default_value(self):
1716 spec = importlib .util .spec_from_file_location ("config" , config_path )
1817 config = importlib .util .module_from_spec (spec )
1918 spec .loader .exec_module (config )
20-
19+
2120 self .assertFalse (config .DISABLE_CLASS_SORTING )
2221
2322 def test_disable_class_sorting_env_var_true (self ):
@@ -27,7 +26,7 @@ def test_disable_class_sorting_env_var_true(self):
2726 spec = importlib .util .spec_from_file_location ("config" , config_path )
2827 config = importlib .util .module_from_spec (spec )
2928 spec .loader .exec_module (config )
30-
29+
3130 # After reload, should be True
3231 self .assertTrue (config .DISABLE_CLASS_SORTING )
3332
@@ -37,7 +36,7 @@ def test_disable_class_sorting_env_var_false(self):
3736 spec = importlib .util .spec_from_file_location ("config" , config_path )
3837 config = importlib .util .module_from_spec (spec )
3938 spec .loader .exec_module (config )
40-
39+
4140 self .assertFalse (config .DISABLE_CLASS_SORTING )
4241
4342 def test_disable_class_sorting_env_var_case_insensitive (self ):
@@ -47,15 +46,15 @@ def test_disable_class_sorting_env_var_case_insensitive(self):
4746 spec = importlib .util .spec_from_file_location ("config" , config_path )
4847 config = importlib .util .module_from_spec (spec )
4948 spec .loader .exec_module (config )
50-
49+
5150 self .assertTrue (config .DISABLE_CLASS_SORTING )
5251
5352 def test_config_import (self ):
5453 """Test that DISABLE_CLASS_SORTING exists and is a boolean."""
5554 spec = importlib .util .spec_from_file_location ("config" , config_path )
5655 config = importlib .util .module_from_spec (spec )
5756 spec .loader .exec_module (config )
58-
57+
5958 config_value = config .DISABLE_CLASS_SORTING
6059 self .assertIsNotNone (config_value )
6160 self .assertIsInstance (config_value , bool )
0 commit comments