File tree 2 files changed +13
-12
lines changed
2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,10 @@ def set(self, *args):
88
88
elif isinstance (args [0 ], dict ):
89
89
key_values = args [0 ]
90
90
else :
91
- raise TypeError (f"Unsupported argument type. Expects two arguments consisting \
92
- of key and value pair, or a dictionary of key value pairs" )
91
+ raise TypeError (
92
+ f"Unsupported argument type. Expects two arguments consisting \
93
+ of key and value pair, or a dictionary of key-value pairs"
94
+ )
93
95
94
96
for name , value in key_values .items ():
95
97
with raise_keyerror (name ):
@@ -102,7 +104,7 @@ def set(self, *args):
102
104
if not isinstance (value , type (saved_value )):
103
105
cast_value = type (saved_value )(value )
104
106
if saved_value != cast_value :
105
- raise ValueError (f"Unexpected retrieved value { saved_value } for key { name } . Expected { cast_value } " )
107
+ raise ValueError (f"Unexpected retrieved value { saved_value } . Expected { cast_value } " )
106
108
107
109
def get_array (self , name ):
108
110
"""Get the value of the given key as an array
Original file line number Diff line number Diff line change @@ -68,19 +68,18 @@ def test_message_set():
68
68
def test_message_set_multiple ():
69
69
with eccodes .FileReader (TEST_GRIB_DATA ) as reader :
70
70
message = next (reader )
71
- message .set ({
72
- "centre" : "ecmf" ,
73
- "numberOfValues" : 10 ,
74
- "shortName" : "z" ,
75
- })
71
+ message .set (
72
+ {
73
+ "centre" : "ecmf" ,
74
+ "numberOfValues" : 10 ,
75
+ "shortName" : "z" ,
76
+ }
77
+ )
76
78
with pytest .raises (TypeError ):
77
79
message .set ("centre" , "ecmwf" , 2 )
78
80
with pytest .raises (ValueError ):
79
81
message .set ("stepRange" , "0-12" )
80
- message .set ({
81
- "stepType" : "max" ,
82
- "stepRange" : "0-12"
83
- })
82
+ message .set ({"stepType" : "max" , "stepRange" : "0-12" })
84
83
85
84
86
85
def test_message_iter ():
You can’t perform that action at this time.
0 commit comments