Ejemplo n.º 1
0
    def test_detect_trusted_in_general_not_trusted_in_eur(self, post_mock):
        """ Test if is_trust_set detects trusted in general peer
            but not trusted in certain currency (EUR)
        """
        response = Response()
        response._content = json.dumps({u"result": data})
        post_mock.return_value = response

        is_trusted_in_general = ripple_api.is_trust_set(self.account,
                                                        self.trusted_peer,
                                                        servers=self.servers)

        self.assertEqual(is_trusted_in_general, True)
        is_trusted_eur = ripple_api.is_trust_set(self.account,
                                                 self.trusted_peer,
                                                 currency="EUR",
                                                 servers=self.servers)

        self.assertEqual(is_trusted_eur, False)
Ejemplo n.º 2
0
    def test_detect_untrusted_peer(self, post_mock):
        """ Test if is_trust_set detects untrusted peer
        """
        response = Response()
        response._content = json.dumps({u"result": untrusted_data})
        post_mock.return_value = response

        is_trusted = ripple_api.is_trust_set(self.account,
                                             self.untrusted_peer,
                                             currency="USD",
                                             servers=self.servers)

        self.assertEqual(is_trusted, False)
Ejemplo n.º 3
0
    def test_detect_limit_not_enough(self, post_mock):
        """ Test if is_trust_set detects if limit is not enough
        """
        response = Response()
        response._content = json.dumps({u"result": data})
        post_mock.return_value = response

        is_trusted = ripple_api.is_trust_set(self.account,
                                             self.untrusted_peer,
                                             currency="USD",
                                             limit=self.usd_overgranted_limit,
                                             servers=self.servers)

        self.assertEqual(is_trusted, False)