Completed
Push — stage ( 8ef157...e32083 )
by Michael
06:13
created

test_repository_parses_remote_url()   B

Complexity

Conditions 5

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 5
c 3
b 0
f 0
dl 0
loc 6
rs 8.5454
1
from plumbum.cmd import git
0 ignored issues
show
Configuration introduced by
The import plumbum.cmd could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
2
from semantic_version import Version
0 ignored issues
show
Configuration introduced by
The import semantic_version could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
3
4
from changes import models
5
6
7
def test_repository_parses_remote_url(git_repo):
0 ignored issues
show
Coding Style Naming introduced by
The name test_repository_parses_remote_url does not conform to the function naming conventions ([a-z_][a-z0-9_]{2,30}$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
8
    repository = models.GitRepository()
9
    assert 'test_app' == repository.repo
10
    assert 'michaeljoseph' == repository.owner
11
    assert repository.is_github
12
    assert repository.platform == 'github'
13
14
15
def test_repository_parses_versions(git_repo):
16
    repository = models.GitRepository()
17
18
    v1 = Version('0.0.1')
0 ignored issues
show
Coding Style Naming introduced by
The name v1 does not conform to the variable naming conventions ([a-z_][a-z0-9_]{2,30}$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
19
20
    assert [v1] == repository.versions
21
22
    assert v1 == repository.latest_version
23
24
# FIXME
25
# def test_latest_version_unreleased(git_repo):
26
#     repository = models.GitRepository()
27
#
28
#     assert 0 == len(repository.versions)
29
#
30
#     assert models.GitRepository.VERSION_ZERO == repository.latest_version
31
32
33
def test_latest_version(git_repo):
34
    git('tag', '0.0.2')
35
    git('tag', '0.0.3')
36
37
    repository = models.GitRepository()
38
39
    expected_versions = [
40
        Version('0.0.1'),
41
        Version('0.0.2'),
42
        Version('0.0.3'),
43
    ]
44
    assert expected_versions == repository.versions
45
46
    assert Version('0.0.3') == repository.latest_version
47