summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/ONAPLibrary/Base64Keywords.py
blob: a87a4b9993125ea28acd53713776b7ce743c5452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from robot.api.deco import keyword
import base64


class Base64Keywords(object):
    """ Utilities useful for generating UUIDs """

    def __init__(self):
        super(Base64Keywords, self).__init__()

    @keyword
    def base64_encode(self, string_to_encode):
        """generate a base64 encoded string"""
        return base64.b64encode(self, string_to_encode)

    @keyword
    def base64_decode(self, string_to_decode):
        """decode a base64 encoded string"""
        return base64.b64decode(self, string_to_decode)