Exemplo n.º 1
0
    def test_substitutions(self):

        sub = Substitutions()

        sub.load_substitutions(os.path.dirname(__file__) + os.sep + "subs.txt")

        self.assertEquals("My name is Fred West", sub.replace("My name is $FIRSTNAME $SURNAME"))
        self.assertEquals("My name is FredWest", sub.replace("My name is $FIRSTNAME$SURNAME"))
Exemplo n.º 2
0
    def _replace_subs(self, subs: Substitutions, value):
        if subs is not None:
            return subs.replace(value)

        return value