Exemplo n.º 1
0
 def test__camelize__when_string_contains_underlines(self):
     result1 = jnc.camelize('test_string_')
     result2 = jnc.camelize('TEST_STRING_')
     expected = 'test_string_'
     message = 'should not remove underlines'
     assert result1 == expected, message + ' but was ' + result1
     assert result2 == expected, message + ' but was ' + result2
Exemplo n.º 2
0
 def test__camelize__when_string_contains_underlines(self):
     result1 = jnc.camelize('test_string_')
     result2 = jnc.camelize('TEST_STRING_')
     expected = 'test_string_'
     message = 'should not remove underlines'
     assert result1 == expected, message + ' but was ' + result1
     assert result2 == expected, message + ' but was ' + result2
Exemplo n.º 3
0
 def test__camelize__when_string_contains_hyphens(self):
     result1 = jnc.camelize('test-string')
     result2 = jnc.camelize('TEST-STRING')
     expected = 'testString'
     message = 'should remove hyphens'
     assert result1 == expected, message + ' but was ' + result1
     assert result2 == expected, message + ' but was ' + result2
Exemplo n.º 4
0
 def test__camelize__when_string_contains_hyphens(self):
     result1 = jnc.camelize('test-string')
     result2 = jnc.camelize('TEST-STRING')
     expected = 'testString'
     message = 'should remove hyphens'
     assert result1 == expected, message + ' but was ' + result1
     assert result2 == expected, message + ' but was ' + result2
Exemplo n.º 5
0
 def test__camelize__when_string_is_single_character(self):
     result = jnc.camelize('A')
     expected = 'a'
     message = 'should return lower case version of string'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 6
0
 def test__camelize__when_string_is_none(self):
     result = jnc.camelize(None)
     expected = ''
     message = 'should return empty string'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 7
0
 def test__camelize__when_string_is_upper_camelcase(self):
     result = jnc.camelize('TestString')
     expected = 'testString'
     message = 'should return string decapitalized'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 8
0
 def test__camelize__when_string_is_lower_camelcase(self):
     result = jnc.camelize('testString')
     expected = 'testString'
     message = 'should return string unchanged'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 9
0
 def test__camelize__when_string_is_lower_camelcase(self):
     result = jnc.camelize('testString')
     expected = 'testString'
     message = 'should return string unchanged'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 10
0
 def test__camelize__when_string_contains_many_dots_and_hyphens(self):
     result = jnc.camelize('test--...STR.ING.')
     expected = 'test-.StrIng.'  # 'testStrIng' might be better
     message = 'will remove all except consecutive and trailing'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 11
0
 def test__camelize__when_string_contains_trailing_hyphen(self):
     result = jnc.camelize('test-')
     expected = 'test-'  # 'test' might be better
     message = 'will not remove hyphen'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 12
0
 def test__camelize__when_string_is_single_character(self):
     result = jnc.camelize('A')
     expected = 'a'
     message = 'should return lower case version of string'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 13
0
 def test__camelize__when_string_is_none(self):
     result = jnc.camelize(None)
     expected = ''
     message = 'should return empty string'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 14
0
 def test__camelize__when_string_is_upper_camelcase(self):
     result = jnc.camelize('TestString')
     expected = 'testString'
     message = 'should return string decapitalized'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 15
0
 def test__camelize__when_string_contains_trailing_hyphen(self):
     result = jnc.camelize('test-')
     expected = 'test-'  # 'test' might be better
     message = 'will not remove hyphen'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 16
0
 def test__camelize__when_string_is_all_upper_case(self):
     result = jnc.camelize('TESTSTRING')
     expected = 'teststring'
     message = 'should convert to lower case'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 17
0
 def test__camelize__when_string_contains_many_dots_and_hyphens(self):
     result = jnc.camelize('test--...STR.ING.')
     expected = 'test-.StrIng.'  # 'testStrIng' might be better
     message = 'will remove all except consecutive and trailing'
     assert result == expected, message + ' but was ' + result
Exemplo n.º 18
0
 def test__camelize__when_string_is_all_upper_case(self):
     result = jnc.camelize('TESTSTRING')
     expected = 'teststring'
     message = 'should convert to lower case'
     assert result == expected, message + ' but was ' + result