def check_status(self): """Define the functionality of the health check.""" from dashboard.utils import get_ipfs try: ipfs_connection = get_ipfs(host='https://ipfs.infura.io', port=5001) except IPFSCantConnectException: ipfs_connection = None if not ipfs_connection: raise HealthCheckException('Infura IPFS Unreachable')
def check_status(self): """Define the functionality of the health check.""" from dashboard.utils import get_ipfs try: ipfs_connection = get_ipfs() except IPFSCantConnectException: ipfs_connection = None if not ipfs_connection: raise HealthCheckException('Default IPFS Unreachable')
def test_get_ipfs(): """Test that IPFS connectivity to gateway defined in settings succeeds.""" ipfs = get_ipfs() assert type(ipfs) is ipfshttpclient.client.Client
def test_get_ipfs_with_bad_host(): """Test that IPFS connectivity to gateway fails when bad host is passed.""" with pytest.raises(IPFSCantConnectException): assert get_ipfs('nohost.com')
def check_status(self): """Define the functionality of the health check.""" ipfs_connection = get_ipfs() if not ipfs_connection: raise HealthCheckException('IPFS Unreachable')