Exemplo n.º 1
0
    def test_sha256_text(self, mock_hashlib):
        """Test ShardManager._sha256"""
        test_data = 'ab'

        output = ShardManager._ripemd160(test_data)

        mock_hashlib.new.assert_called_with('ripemd160', test_data)
        mock_hashlib.new.return_value.digest.assert_called_once_with()
Exemplo n.º 2
0
    def test_sha256_text(self, mock_hashlib):
        """Test ShardManager._sha256"""
        test_data = 'ab'

        output = ShardManager._ripemd160(test_data)

        mock_hashlib.new.assert_called_with('ripemd160', test_data)
        mock_hashlib.new.return_value.digest.assert_called_once_with()
Exemplo n.º 3
0
    def test_ripemd160_binary(self, mock_hashlib):
        """Test ShardManager._ripemd160"""
        test_data = b'ab'

        output = ShardManager._ripemd160(test_data)

        assert output is not None

        mock_hashlib.new.assert_called_with('ripemd160', test_data)
        mock_hashlib.new.return_value.digest.assert_called_once_with()
Exemplo n.º 4
0
    def test_ripemd160_binary(self, mock_hashlib):
        """Test ShardManager._ripemd160"""
        test_data = b'ab'

        output = ShardManager._ripemd160(test_data)

        assert output is not None

        mock_hashlib.new.assert_called_with('ripemd160', test_data)
        mock_hashlib.new.return_value.digest.assert_called_once_with()