Passed
Pull Request — master (#7)
by
unknown
04:02
created

test.test_url_join   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 8
eloc 36
dl 0
loc 46
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A TestURLJoin.test_bare_host_and_path_without_slash() 0 4 1
A TestURLJoin.test_host_with_path_no_slash_and_path_with_slash() 0 4 1
A TestURLJoin.test_bare_host_and_path_with_slash() 0 4 1
A TestURLJoin.test_host_with_slash_and_path_without_slash() 0 4 1
A TestURLJoin.test_host_with_slash_and_path_with_slash() 0 4 1
A TestURLJoin.test_host_with_path_no_slash_and_path_without_slash() 0 4 1
A TestURLJoin.test_host_with_path_and_slash_and_path_without_slash() 0 4 1
A TestURLJoin.test_host_with_path_and_slash_and_path_with_slash() 0 4 1
1
from unittest import TestCase
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 helpers import url_join
0 ignored issues
show
Bug introduced by
The name url_join does not seem to exist in module helpers.
Loading history...
4
5
6
class TestURLJoin(TestCase):
0 ignored issues
show
Coding Style introduced by
This class 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...
7
    def test_bare_host_and_path_with_slash(self):
8
        host = "http://example.com"
9
        path = "/some/path"
10
        self.assertEqual(url_join(host, path), "http://example.com/some/path")
11
12
    def test_bare_host_and_path_without_slash(self):
13
        host = "http://example.com"
14
        path = "some/path"
15
        self.assertEqual(url_join(host, path), "http://example.com/some/path")
16
17
    def test_host_with_slash_and_path_with_slash(self):
18
        host = "http://example.com/"
19
        path = "/some/path"
20
        self.assertEqual(url_join(host, path), "http://example.com/some/path")
21
22
    def test_host_with_slash_and_path_without_slash(self):
23
        host = "http://example.com/"
24
        path = "some/path"
25
        self.assertEqual(url_join(host, path), "http://example.com/some/path")
26
27
    def test_host_with_path_no_slash_and_path_with_slash(self):
28
        host = "http://example.com/test"
29
        path = "/some/path"
30
        self.assertEqual(url_join(host, path), "http://example.com/test/some/path")
31
32
    def test_host_with_path_no_slash_and_path_without_slash(self):
33
        host = "http://example.com/test"
34
        path = "some/path"
35
        self.assertEqual(url_join(host, path), "http://example.com/test/some/path")
36
37
    def test_host_with_path_and_slash_and_path_without_slash(self):
38
        host = "http://example.com/test/"
39
        path = "some/path"
40
        self.assertEqual(url_join(host, path), "http://example.com/test/some/path")
41
42
    def test_host_with_path_and_slash_and_path_with_slash(self):
43
        host = "http://example.com/test/"
44
        path = "/some/path"
45
        self.assertEqual(url_join(host, path), "http://example.com/test/some/path")
46