def test_token_max_length_fail(): tk = Token(maxLength=8) value = ' value is too long' tk.to_python(value)
def test_token_value_type_fail(): tk = Token() value = 21 tk.to_python(value)
def test_token_min_length_fail(): tk = Token(minLength=8) value = 'short' tk.to_python(value)
def test_token_whitespace_fail(): tk = Token() value = 'Test string with uncollapsed whitespace.' tk.to_python(value)
def test_token_pass(): tk = Token() value = ' Test string with collapsed whitespace.' actual = tk.to_python(value) nose.tools.eq_(actual, value)
def test_token_build_pass(): actual = Token().build() nose.tools.eq_(actual, 'Token')
def test_token_str_pass(): actual = str(Token()) nose.tools.eq_(actual, 'Token')
def test_token_build_value_pass(): value = ' Test string with collapsed whitespace.' actual = Token().build(value) nose.tools.eq_(actual, value)