Esempio 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))
Esempio n. 2
0
File: go_test.py Progetto: 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))
Esempio 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))
Esempio n. 4
0
File: go_test.py Progetto: 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))