Completed
Push — master ( 5883b4...f4d2f1 )
by Philip
01:17
created

TestSnakeCamel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_camel_to_snake_case() 0 5 1
A test_snake_to_camel_case() 0 5 1
1
import unittest
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