@@ -83,6 +83,37 @@ def test_import_success(self, api_client_maker, tmp_path, monkeypatch):
8383 )
8484 assert response == [self .key ]
8585
86+ @pytest .mark .parametrize (
87+ "falsy_value" ,
88+ [
89+ "" ,
90+ 0 ,
91+ False ,
92+ ],
93+ ids = ["empty_string" , "zero" , "false" ],
94+ )
95+ def test_import_falsy_values (self , api_client_maker , tmp_path , monkeypatch , falsy_value ):
96+ """Test that falsy values (empty string, 0, False) are correctly imported."""
97+ api_client = api_client_maker (
98+ path = "/api/v2/variables" ,
99+ response_json = self .bulk_response_success .model_dump (),
100+ expected_http_status_code = 200 ,
101+ kind = ClientKind .CLI ,
102+ )
103+
104+ monkeypatch .chdir (tmp_path )
105+ expected_json_path = tmp_path / self .export_file_name
106+ variable_file = {
107+ self .key : {"value" : falsy_value , "description" : "test falsy value" },
108+ }
109+
110+ expected_json_path .write_text (json .dumps (variable_file ))
111+ response = variable_command .import_ (
112+ self .parser .parse_args (["variables" , "import" , expected_json_path .as_posix ()]),
113+ api_client = api_client ,
114+ )
115+ assert response == [self .key ]
116+
86117 def test_import_error (self , api_client_maker , tmp_path , monkeypatch ):
87118 api_client = api_client_maker (
88119 path = "/api/v2/variables" ,
0 commit comments