Beispiel #1
0
def test_encode_dict():
    assert "eyJhcHAiOiJicmFuZGVuYnVyZyJ9" == Funcs.encode(
        {"app": "brandenburg"})
Beispiel #2
0
 def execute(event: Dict[str, str], context):
     logger.info("Starting service")
     data: Dict[str, str] = Funcs.decode(event.get("data"))
     attrs: Dict[str, str] = event.get("attributes")
     sf: SalesforceBroker = SalesforceBroker()
     sf.handle(data)
Beispiel #3
0
def test_clean_spaced_phonenumber():
    assert "+5521934452312" == Funcs.normalize_phonenumber("55 21 9 3445 2312")
Beispiel #4
0
def test_encode_string():
    assert "YnJhbmRlbmJ1cmc=" == Funcs.encode("brandenburg")
Beispiel #5
0
def test_clean_short_phonenumber():
    assert "" == Funcs.normalize_phonenumber("21 9344523")
Beispiel #6
0
def test_clean_wrong_phonenumber():
    assert "+5521934452312" == Funcs.normalize_phonenumber("(21)934452312")
Beispiel #7
0
def test_not_b64_string():
    assert "abc123" == Funcs.decode("abc123")
Beispiel #8
0
def test_decode_dict():
    assert {
        "app": "brandenburg"
    } == Funcs.decode("eyJhcHAiOiJicmFuZGVuYnVyZyJ9")
Beispiel #9
0
def test_decode_string():
    assert "brandenburg" == Funcs.decode("YnJhbmRlbmJ1cmc=")