@@ -67,10 +67,7 @@ class TestStringShorthand:
6767
6868 def test_string_shorthand_csv (self ):
6969 p = Parameter (code = "district" , type = str , choices = "districts.csv" )
70- assert isinstance (p .choices , ChoicesFromFile )
71- assert p .choices .path == "districts.csv"
72- assert p .choices .format == "csv"
73- assert p .choices .column is None
70+ assert p .choices == ChoicesFromFile ("districts.csv" )
7471
7572 def test_string_shorthand_json (self ):
7673 p = Parameter (code = "district" , type = str , choices = "data/regions.json" )
@@ -104,7 +101,7 @@ def test_static_list_unaffected(self):
104101
105102 def test_explicit_choices_from_file_unaffected (self ):
106103 p = Parameter (code = "district" , type = str , choices = ChoicesFromFile ("districts.csv" , column = "code" ))
107- assert p .choices . column == " code"
104+ assert p .choices == ChoicesFromFile ( "districts.csv" , column = " code")
108105
109106 # --- invalid strings raise clearly ---
110107
@@ -124,7 +121,7 @@ def test_empty_string_raises(self):
124121
125122 def test_shorthand_has_no_column (self ):
126123 p = Parameter (code = "district" , type = str , choices = "districts.csv" )
127- assert p .choices . column is None
124+ assert p .choices == ChoicesFromFile ( "districts.csv" )
128125
129126 def test_decorator_with_string_shorthand (self ):
130127 @parameter (code = "district" , type = str , choices = "districts.csv" )
0 commit comments