1
|
|
|
from os.path import exists |
2
|
|
|
|
3
|
|
|
import click |
|
|
|
|
4
|
|
|
from click.testing import CliRunner |
|
|
|
|
5
|
|
|
from plumbum.cmd import git |
|
|
|
|
6
|
|
|
|
7
|
|
|
from changes import config |
8
|
|
|
from changes.config import Config |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
# def test_no_config(): |
12
|
|
|
# with CliRunner().isolated_filesystem(): |
13
|
|
|
# assert not exists('.changes.toml') |
14
|
|
|
# assert config.project_config() == config.DEFAULTS |
15
|
|
|
# assert exists('.changes.toml') |
16
|
|
|
# |
17
|
|
|
# |
18
|
|
|
# def test_existing_config(): |
19
|
|
|
# with CliRunner().isolated_filesystem(): |
20
|
|
|
# with click.open_file('.changes.toml', 'w') as f: |
21
|
|
|
# f.write( |
22
|
|
|
# '[tool.changes]\n' |
23
|
|
|
# 'project_name = "foo"\n' |
24
|
|
|
# ) |
25
|
|
|
# |
26
|
|
|
# expected_config = {'tool': {'changes': {'project_name': 'foo'}}} |
27
|
|
|
# assert expected_config == config.project_config() |
28
|
|
|
# |
29
|
|
|
# |
30
|
|
|
# def test_malformed_config_returns_dict(): |
31
|
|
|
# |
32
|
|
|
# with CliRunner().isolated_filesystem(): |
33
|
|
|
# with click.open_file('.changes.toml', 'w') as f: |
34
|
|
|
# f.write('something\n\n-another thing\n') |
35
|
|
|
# assert config.project_config() == {} |
36
|
|
|
# |
37
|
|
|
# |
38
|
|
|
# def test_store_settings(): |
39
|
|
|
# with CliRunner().isolated_filesystem(): |
40
|
|
|
# config.store_settings({'foo':'bar'}) |
41
|
|
|
# assert exists('.changes.toml') |
42
|
|
|
# assert config.project_config() == {'foo':'bar'} |
43
|
|
|
# |
44
|
|
|
# |
45
|
|
|
# def test_parsed_repo_url(): |
46
|
|
|
# with CliRunner().isolated_filesystem(): |
47
|
|
|
# git('init') |
48
|
|
|
# git('remote', 'add', 'origin', 'https://github.com/michaeljoseph/test_app.git') |
|
|
|
|
49
|
|
|
# |
50
|
|
|
# context = Config( |
51
|
|
|
# 'something', True, True, True, |
52
|
|
|
# 'requirements.txt', '0.0.2', '0.0.1', |
53
|
|
|
# 'https://github.com/someuser/test_app', None |
54
|
|
|
# ) |
55
|
|
|
|
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.
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.