@@ -67,6 +67,26 @@ def callback():
67
67
deserialize .key (True , mainnet_wif )
68
68
self .assertRaises (exceptions .InvalidWif , callback )
69
69
70
+ # testnet non string
71
+ def callback ():
72
+ deserialize .key (False , None )
73
+ self .assertRaises (exceptions .InvalidInput , callback )
74
+
75
+ # mainnet non string
76
+ def callback ():
77
+ deserialize .key (True , None )
78
+ self .assertRaises (exceptions .InvalidInput , callback )
79
+
80
+ # testnet garbage string
81
+ def callback ():
82
+ deserialize .key (False , "garbage" )
83
+ self .assertRaises (exceptions .InvalidWif , callback )
84
+
85
+ # mainnet garbage string
86
+ def callback ():
87
+ deserialize .key (True , "garbage" )
88
+ self .assertRaises (exceptions .InvalidWif , callback )
89
+
70
90
71
91
class TestAddress (unittest .TestCase ):
72
92
@@ -91,3 +111,23 @@ def callback():
91
111
def callback ():
92
112
deserialize .address (True , mainnet_address )
93
113
self .assertRaises (exceptions .InvalidAddress , callback )
114
+
115
+ # non string testnet
116
+ def callback ():
117
+ deserialize .address (False , None )
118
+ self .assertRaises (exceptions .InvalidInput , callback )
119
+
120
+ # non string mainnet
121
+ def callback ():
122
+ deserialize .address (True , None )
123
+ self .assertRaises (exceptions .InvalidInput , callback )
124
+
125
+ # garbage string testnet
126
+ def callback ():
127
+ deserialize .address (False , "garbage" )
128
+ self .assertRaises (exceptions .InvalidAddress , callback )
129
+
130
+ # garbage string mainnet
131
+ def callback ():
132
+ deserialize .address (True , "garbage" )
133
+ self .assertRaises (exceptions .InvalidAddress , callback )
0 commit comments