File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,19 @@ def test_get_file_info(self):
13
13
l = Lighthouse (os .environ .get ("LIGHTHOUSE_TOKEN" ))
14
14
res = l .getFileInfo ("Qmd5MBBScDUV3Ly8qahXtZFqyRRfYSmUwEcxpYcV4hzKfW" )
15
15
self .assertIsInstance (res , dict , "data is a dict" )
16
- self .assertEqual (res .get ("cid" ),"Qmd5MBBScDUV3Ly8qahXtZFqyRRfYSmUwEcxpYcV4hzKfW" , "cid is matching" )
16
+ self .assertEqual (res .get ("cid" ),"Qmd5MBBScDUV3Ly8qahXtZFqyRRfYSmUwEcxpYcV4hzKfW" , "cid is matching" )
17
+
18
+ def test_get_file_info_invalid_token (self ):
19
+ """test get_upload with invalid token"""
20
+ with self .assertRaises (Exception ) as context :
21
+ l = Lighthouse ("invalid_token" )
22
+ l .getFileInfo ("Qmd5MBBScDUV3Ly8qahXtZFqyRRfYSmUwEcxpYcV4hzKfW" )
23
+ self .assertIn ("authentication failed" , str (context .exception ).lower ())
24
+
25
+ def test_get_file_info_invalid_cid (self ):
26
+ parse_env ()
27
+ l = Lighthouse (os .environ .get ("LIGHTHOUSE_TOKEN" ))
28
+ res = l .getFileInfo ("invalid_cid" )
29
+ self .assertIsInstance (res , dict , "res is dict" )
30
+ self .assertIsInstance (res .get ('error' ), dict , "error is dict" )
31
+ self .assertEqual (res .get ("error" ).get ('message' ), 'Not Found' , 'cid not found' )
You can’t perform that action at this time.
0 commit comments