예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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