# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from unittest import TestCase
from layers.main.CommonLambdaLayer.python.gamekithelpers.sanitizer import sanitize
class TestSanitization(TestCase):
def test_remove_tags(self):
text = "easiest way is just regex and remove tags. " \
"and for HTML we can just remove the links, " \
",
and < link > that can download other resource files " \
"but keep
, and
" expected = "easiest way is just regex and remove and tags. " \ "and for HTML we can just remove the links, " \ ", and that can download other resource files " \ "but keep
, and" result = sanitize(text) self.assertEqual(result, expected) def test_int_input_type_returns_as_is(self): text = 10 expected = 10 result = sanitize(text) self.assertEqual(result, expected) self.assertIsInstance(result, type(text))