예제 #1
0
    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')
예제 #2
0
    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')
예제 #3
0
 def test_get_ipfs():
     """Test that IPFS connectivity to gateway defined in settings succeeds."""
     ipfs = get_ipfs()
     assert type(ipfs) is ipfshttpclient.client.Client
예제 #4
0
 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')
예제 #5
0
 def check_status(self):
     """Define the functionality of the health check."""
     ipfs_connection = get_ipfs()
     if not ipfs_connection:
         raise HealthCheckException('IPFS Unreachable')