コード例 #1
0
    def get_account_used_perc(self):
        """
        Fetch the percentage of available balance is currently used

            - Returns the percentage of account used over total available amount
        """
        balance, deposit = self.get_account_balances()
        if balance is None or deposit is None:
            return None
        return Utils.percentage(deposit, balance)
コード例 #2
0
def test_percentage():
    assert Utils.percentage(1, 100) == 1
    assert Utils.percentage(0, 100) == 0
    assert Utils.percentage(200, 100) == 200