Ejemplo n.º 1
0
    def test_sanitary_should_return_url(self):
        """
        Verify that dashes and / are considered sanitary characters
        :return:
        """
        url = "this-is-a-valid-name"
        self.assertEqual(url, go.sanitary(url))

        url = "this-is-a-valid-name/"
        self.assertEqual(url, go.sanitary(url))
Ejemplo n.º 2
0
Archivo: go_test.py Proyecto: p16n/f5go
    def test_sanitary_should_return_url(self):
        """
        Verify that dashes and / are considered sanitary characters
        :return:
        """
        url = "this-is-a-valid-name"
        self.assertEqual(url, go.sanitary(url))

        url = "this-is-a-valid-name/"
        self.assertEqual(url, go.sanitary(url))
Ejemplo n.º 3
0
    def test_sanitary_should_return_None(self):
        """
        Verify that underscores are marked as unsanitary charachters
        :return:
        """
        # While in theory underscores are fine, we block them as unsanitary
        url = "this_is_an_invalid_name"
        self.assertEqual(None, go.sanitary(url))

        # There's a branch that specifically checks the last character is valid or /
        url = "this-is-an-invalid-name_"
        self.assertEqual(None, go.sanitary(url))
Ejemplo n.º 4
0
Archivo: go_test.py Proyecto: p16n/f5go
    def test_sanitary_should_return_None(self):
        """
        Verify that underscores are marked as unsanitary charachters
        :return:
        """
        # While in theory underscores are fine, we block them as unsanitary
        url = "this_is_an_invalid_name"
        self.assertEqual(None, go.sanitary(url))

        # There's a branch that specifically checks the last character is valid or /
        url = "this-is-an-invalid-name_"
        self.assertEqual(None, go.sanitary(url))