コード例 #1
0
ファイル: healthchecks.py プロジェクト: anar1111/HeSameweb
    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
ファイル: healthchecks.py プロジェクト: anar1111/HeSameweb
    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')