55import pytest
66
77from pins .tests .helpers import DEFAULT_CREATION_DATE , rm_env
8+ from pins .config import PINS_ENV_INSECURE_READ
89from pins .errors import PinsError , PinsInsecureReadError
910from pins .meta import MetaRaw
1011
@@ -112,8 +113,8 @@ def test_board_pin_write_rsc_index_html(board, tmp_dir2, snapshot):
112113 "obj, type_" , [(df , "csv" ), (df , "joblib" ), ({"a" : 1 , "b" : [2 , 3 ]}, "joblib" )]
113114)
114115def test_board_pin_write_type (board , obj , type_ , request ):
115- with rm_env ("PINS_ALLOW_INSECURE_READ" ):
116- os .environ ["PINS_ALLOW_INSECURE_READ" ] = "1"
116+ with rm_env (PINS_ENV_INSECURE_READ ):
117+ os .environ [PINS_ENV_INSECURE_READ ] = "1"
117118 meta = board .pin_write (obj , "test_pin" , type = type_ , title = "some title" )
118119 dst_obj = board .pin_read ("test_pin" )
119120
@@ -135,19 +136,19 @@ def test_board_pin_read_insecure_fail_default(board):
135136
136137def test_board_pin_read_insecure_fail_board_flag (board ):
137138 # board flag prioritized over env var
138- with rm_env ("PINS_ALLOW_INSECURE_READ" ):
139- os .environ ["PINS_ALLOW_INSECURE_READ" ] = "1"
140- board .allow_insecure_read = False
139+ with rm_env (PINS_ENV_INSECURE_READ ):
140+ os .environ [PINS_ENV_INSECURE_READ ] = "1"
141+ board .allow_pickle_read = False
141142 board .pin_write ({"a" : 1 }, "test_pin" , type = "joblib" , title = "some title" )
142143 with pytest .raises (PinsInsecureReadError ):
143144 board .pin_read ("test_pin" )
144145
145146
146147def test_board_pin_read_insecure_succeed_board_flag (board ):
147148 # board flag prioritized over env var
148- with rm_env ("PINS_ALLOW_INSECURE_READ" ):
149- os .environ ["PINS_ALLOW_INSECURE_READ" ] = "0"
150- board .allow_insecure_read = True
149+ with rm_env (PINS_ENV_INSECURE_READ ):
150+ os .environ [PINS_ENV_INSECURE_READ ] = "0"
151+ board .allow_pickle_read = True
151152 board .pin_write ({"a" : 1 }, "test_pin" , type = "joblib" , title = "some title" )
152153 board .pin_read ("test_pin" )
153154
0 commit comments