File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 44class Config :
55 """Config class for lighthouse"""
66
7- lighthouse_api = "https://api.lighthouse.storage"
7+ lighthouse_api = "http://13.234.35.183:5050" # " https://api.lighthouse.storage"
88 lighthouse_node = "https://node.lighthouse.storage"
99 lighthouse_bls_node = "https://encryption.lighthouse.storage"
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3+ import os
34import lighthouse .deploy as d
45from lighthouse import types as t
56
67
78class Lighthouse :
8- def __init__ (self , token : str ):
9- self .token = token
9+ def __init__ (self , token : str = "" ):
10+ self .token = token or os .environ .get ("LIGHTHOUSE_TOKEN" , "" )
11+ if not self .token :
12+ raise Exception (
13+ "No token provided: Please provide a token or set the LIGHTHOUSE_TOKEN environment variable"
14+ )
1015
1116 def deploy (self , source : str ) -> t .Deploy :
1217 """
Original file line number Diff line number Diff line change @@ -13,14 +13,14 @@ def setUp(self) -> None:
1313
1414 def test_deploy_file (self ):
1515 """test deploy function"""
16- l = Lighthouse (os . environ . get ( "LH_TOKEN" , "" ))
16+ l = Lighthouse () # will use env var
1717 res = l .deploy ("tests/testdir/testfile.txt" )
1818 self .assertNotEqual (res .get ("data" ), None , "data is None" )
1919 self .assertNotEqual (res .get ("data" ).get ("Hash" ), None , "data is None" )
2020
2121 def test_deploy_dir (self ):
2222 """test deploy function"""
23- l = Lighthouse (os .environ ["LH_TOKEN " ])
23+ l = Lighthouse (os .environ ["LIGHTHOUSE_TOKEN " ])
2424 res = l .deploy ("tests/testdir/" )
2525 self .assertNotEqual (res .get ("data" ), None , "data is None" )
2626 self .assertIsInstance (res .get ("data" ), dict , "data is a dict" )
You can’t perform that action at this time.
0 commit comments