TestSnakeCamel.test_snake_to_camel_case()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
1
import unittest
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
from foil.strings import camel_to_snake, snake_to_camel
4
5
6
class TestSnakeCamel(unittest.TestCase):
7
8
    def test_camel_to_snake_case(self):
9
        expected = 'hello_world'
10
        result = camel_to_snake('helloWorld')
11
12
        self.assertEqual(expected, result)
13
14
    def test_snake_to_camel_case(self):
15
        expected = '123HelloWorld'
16
        result = snake_to_camel('123_hello_world')
17
18
        self.assertEqual(expected, result)
19