#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Napisz funkcję char_sum, która dla zadanego łańcucha zwraca
sumę kodów ASCII znaków.
"""
def char_sum(text):
    sumaAsci = 0
    text_tmp = str(text)
    text_tmp=text_tmp.replace('[','')
    text_tmp = text_tmp.replace(']', '')
    text_tmp = text_tmp.replace("'", '')
    for i in text_tmp:
         sumaAsci += ord(i)
    return sumaAsci

def tests(f):
    inputs = [["this is a string"], ["this is another string"]]
    outputs = [1516, 2172]

    for input, output in zip(inputs, outputs):
        if f(*input) != output:
            return "ERROR: {}!={}".format(f(*input), output)
            break
    return "TESTS PASSED"

if __name__ == "__main__":
    print(tests(char_sum))