Пример #1
0
    def test_validate_no_whitespace(self):
        data = 'no_white_space'
        result = attributes._validate_no_whitespace(data)
        self.assertEqual(data, result)

        self.assertRaises(n_exc.InvalidInput,
                          attributes._validate_no_whitespace,
                          'i have whitespace')

        self.assertRaises(n_exc.InvalidInput,
                          attributes._validate_no_whitespace,
                          'i\thave\twhitespace')
Пример #2
0
    def test_validate_no_whitespace(self):
        data = 'no_white_space'
        result = attributes._validate_no_whitespace(data)
        self.assertEqual(data, result)

        self.assertRaises(n_exc.InvalidInput,
                          attributes._validate_no_whitespace,
                          'i have whitespace')

        self.assertRaises(n_exc.InvalidInput,
                          attributes._validate_no_whitespace,
                          'i\thave\twhitespace')