Completed
Pull Request — develop (#140)
by
unknown
19:55 queued 18:38
created

config()   B

Complexity

Conditions 5

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 7
Bugs 4 Features 0
Metric Value
cc 5
c 7
b 4
f 0
dl 0
loc 23
rs 8.2508
1
# pylint: disable=redefined-outer-name,unused-argument,unused-variable,singleton-comparison,expression-not-assigned
0 ignored issues
show
introduced by
Bad option value 'singleton-comparison'
Loading history...
introduced by
Locally disabling redefined-outer-name (W0621)
Loading history...
introduced by
Locally disabling unused-argument (W0613)
Loading history...
introduced by
Locally disabling unused-variable (W0612)
Loading history...
introduced by
Locally disabling expression-not-assigned (W0106)
Loading history...
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
import os
4
import shutil
5
from contextlib import suppress
6
import logging
7
import tempfile
8
9
import pytest
10
from expecter import expect
0 ignored issues
show
Configuration introduced by
The import expecter 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...
11
from freezegun import freeze_time
0 ignored issues
show
Configuration introduced by
The import freezegun 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...
12
13
import gitman
14
from gitman.models import Config
15
from gitman.exceptions import UncommittedChanges, InvalidRepository
16
17
from .utilities import strip
18
19
20
CONFIG = """
21
location: deps
22
sources:
23
- name: gitman_1
24
  link: ''
25
  repo: https://github.com/jacebrowning/gitman-demo
26
  rev: example-branch
27
- name: gitman_2
28
  link: ''
29
  repo: https://github.com/jacebrowning/gitman-demo
30
  rev: example-tag
31
- name: gitman_3
32
  link: ''
33
  repo: https://github.com/jacebrowning/gitman-demo
34
  rev: 9bf18e16b956041f0267c21baad555a23237b52e
35
""".lstrip()
36
37
log = logging.getLogger(__name__)
0 ignored issues
show
Coding Style Naming introduced by
The name log does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

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...
38
39
40
@pytest.fixture
41
def config(root=os.path.normpath(tempfile.gettempdir() + "/gitman-shared")):
0 ignored issues
show
Coding Style introduced by
This function 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...
42
    with suppress(FileNotFoundError, PermissionError):
43
        shutil.rmtree(root)
44
    with suppress(FileExistsError):
45
        os.makedirs(root)
46
    os.chdir(root)
47
    log.info("Temporary directory: %s", root)
48
49
    if os.name == 'nt':
50
        if not os.path.exists(".git"):
51
            os.system('type nul >>.git')
52
        else:
53
            os.system('copy /b ".git" +,, 1>nul')
54
    else:
55
        os.system("touch .git")
56
57
    config = Config(root=root)
58
    config.__mapper__.text = CONFIG  # pylint: disable=no-member
0 ignored issues
show
introduced by
Locally disabling no-member (E1101)
Loading history...
59
60
    log.debug("File listing: %s", os.listdir(root))
61
62
    return config
63
64
65
def describe_install():
0 ignored issues
show
Coding Style introduced by
This function 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...
66
67
    def it_creates_missing_directories(config):
0 ignored issues
show
Coding Style introduced by
This function 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...
68
        expect(os.path.isdir(config.location)) == False
69
70
        expect(gitman.install('gitman_1', depth=1)) == True
71
72
        expect(os.listdir(config.location)) == ['gitman_1']
73
74
    def it_should_not_modify_config(config):
0 ignored issues
show
Coding Style introduced by
This function 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...
75
        expect(gitman.install('gitman_1', depth=1)) == True
76
77
        expect(config.__mapper__.text) == CONFIG
78
79
    def it_merges_sources(config):
0 ignored issues
show
Coding Style introduced by
This function 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...
80
        config.__mapper__.text = strip("""
81
        location: deps
82
        sources:
83
        - name: gitman_1
84
          link: ''
85
          repo: https://github.com/jacebrowning/gitman-demo
86
          rev: example-branch
87
        sources_locked:
88
        - name: gitman_2
89
          link: ''
90
          repo: https://github.com/jacebrowning/gitman-demo
91
          rev: example-branch
92
        - name: gitman_3
93
          link: ''
94
          repo: https://github.com/jacebrowning/gitman-demo
95
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
96
        """)
97
98
        expect(gitman.install(depth=1)) == True
99
100
        expect(len(os.listdir(config.location))) == 3
101
102
    def it_can_handle_missing_locked_sources(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_can_handle_missing_locked_sources 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...
Coding Style introduced by
This function 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...
103
        config.__mapper__.text = strip("""
104
        location: deps
105
        sources:
106
        - name: gitman_1
107
          link: ''
108
          repo: https://github.com/jacebrowning/gitman-demo
109
          rev: example-branch
110
        sources_locked:
111
        - name: gitman_2
112
          link: ''
113
          repo: https://github.com/jacebrowning/gitman-demo
114
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
115
        """)
116
117
        expect(gitman.install('gitman_1', depth=1)) == True
118
119
        expect(os.listdir(config.location)) == ['gitman_1']
120
121
    def describe_links():
0 ignored issues
show
Coding Style introduced by
This function 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...
122
123
        @pytest.fixture
124
        def config_with_link(config):
0 ignored issues
show
Coding Style introduced by
This function 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...
125
            config.__mapper__.text = strip("""
126
            location: deps
127
            sources:
128
            - name: gitman_1
129
              link: my_link
130
              repo: https://github.com/jacebrowning/gitman-demo
131
              rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
132
            """)
133
134
            return config
135
136
        @pytest.mark.skipif(os.name == 'nt', reason="no symlink on Windows")
137
        def it_should_create_links(config_with_link):
0 ignored issues
show
Coding Style introduced by
This function 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...
138
            expect(gitman.install(depth=1)) == True
139
140
            expect(os.listdir()).contains('my_link')
141
142
        @pytest.mark.skipif(os.name == 'nt', reason="no symlink on Windows")
143
        def it_should_not_overwrite_files(config_with_link):
0 ignored issues
show
Coding Style introduced by
This function 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...
144
            os.system("touch my_link")
145
146
            with pytest.raises(RuntimeError):
147
                gitman.install(depth=1)
148
149
        @pytest.mark.skipif(os.name == 'nt', reason="no symlink on Windows")
150
        def it_overwrites_files_with_force(config_with_link):
0 ignored issues
show
Coding Style introduced by
This function 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...
151
            os.system("touch my_link")
152
153
            expect(gitman.install(depth=1, force=True)) == True
154
155
156
def describe_uninstall():
0 ignored issues
show
Coding Style introduced by
This function 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...
157
158
    def it_deletes_dependencies_when_they_exist(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_deletes_dependencies_when_they_exist 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...
Coding Style introduced by
This function 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...
159
        gitman.install('gitman_1', depth=1)
160
        expect(os.path.isdir(config.location)) == True
161
162
        expect(gitman.uninstall()) == True
163
164
        expect(os.path.exists(config.location)) == False
165
166
    def it_should_not_fail_when_no_dependnecies_exist(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_should_not_fail_when_no_dependnecies_exist 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...
Coding Style introduced by
This function 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...
167
        expect(os.path.isdir(config.location)) == False
168
169
        expect(gitman.uninstall()) == True
170
171
    def it_deletes_the_log_file(config):
0 ignored issues
show
Coding Style introduced by
This function 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...
172
        gitman.install('gitman_1', depth=1)
173
        gitman.list()
174
        expect(os.path.exists(config.log_path)) == True
175
176
        gitman.uninstall()
177
        expect(os.path.exists(config.log_path)) == False
178
179
180
def describe_update():
0 ignored issues
show
Coding Style introduced by
This function 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...
181
182
    def it_should_not_modify_config(config):
0 ignored issues
show
Coding Style introduced by
This function 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...
183
        gitman.update('gitman_1', depth=1)
184
185
        expect(config.__mapper__.text) == CONFIG
186
187
    def it_locks_previously_locked_dependnecies(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_locks_previously_locked_dependnecies 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...
Coding Style introduced by
This function 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...
188
        config.__mapper__.text = strip("""
189
        location: deps
190
        sources:
191
        - name: gitman_1
192
          link: ''
193
          repo: https://github.com/jacebrowning/gitman-demo
194
          rev: example-branch
195
        - name: gitman_2
196
          link: ''
197
          repo: https://github.com/jacebrowning/gitman-demo
198
          rev: example-tag
199
        sources_locked:
200
        - name: gitman_2
201
          link: ''
202
          repo: https://github.com/jacebrowning/gitman-demo
203
          rev: (old revision)
204
        """)
205
206
        gitman.update(depth=1)
207
208
        expect(config.__mapper__.text) == strip("""
209
        location: deps
210
        sources:
211
        - name: gitman_1
212
          link: ''
213
          repo: https://github.com/jacebrowning/gitman-demo
214
          rev: example-branch
215
        - name: gitman_2
216
          link: ''
217
          repo: https://github.com/jacebrowning/gitman-demo
218
          rev: example-tag
219
        sources_locked:
220
        - name: gitman_2
221
          link: ''
222
          repo: https://github.com/jacebrowning/gitman-demo
223
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
224
        """)
225
226
    def it_should_not_lock_dependnecies_when_disabled(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_should_not_lock_dependnecies_when_disabled 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...
Coding Style introduced by
This function 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...
227
        config.__mapper__.text = strip("""
228
        location: deps
229
        sources:
230
        - name: gitman_1
231
          link: ''
232
          repo: https://github.com/jacebrowning/gitman-demo
233
          rev: example-branch
234
        - name: gitman_2
235
          link: ''
236
          repo: https://github.com/jacebrowning/gitman-demo
237
          rev: example-tag
238
        sources_locked:
239
        - name: gitman_2
240
          link: ''
241
          repo: https://github.com/jacebrowning/gitman-demo
242
          rev: (old revision)
243
        """)
244
245
        gitman.update(depth=1, lock=False)
246
247
        expect(config.__mapper__.text) == strip("""
248
        location: deps
249
        sources:
250
        - name: gitman_1
251
          link: ''
252
          repo: https://github.com/jacebrowning/gitman-demo
253
          rev: example-branch
254
        - name: gitman_2
255
          link: ''
256
          repo: https://github.com/jacebrowning/gitman-demo
257
          rev: example-tag
258
        sources_locked:
259
        - name: gitman_2
260
          link: ''
261
          repo: https://github.com/jacebrowning/gitman-demo
262
          rev: (old revision)
263
        """)
264
265
    def it_should_lock_all_dependencies_when_enabled(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_should_lock_all_dependencies_when_enabled 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...
Coding Style introduced by
This function 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...
266
        gitman.update(depth=1, lock=True)
267
268
        expect(config.__mapper__.text) == CONFIG + strip("""
269
        sources_locked:
270
        - name: gitman_1
271
          link: ''
272
          repo: https://github.com/jacebrowning/gitman-demo
273
          rev: 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd
274
        - name: gitman_2
275
          link: ''
276
          repo: https://github.com/jacebrowning/gitman-demo
277
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
278
        - name: gitman_3
279
          link: ''
280
          repo: https://github.com/jacebrowning/gitman-demo
281
          rev: 9bf18e16b956041f0267c21baad555a23237b52e
282
        """)
283
284
285
def describe_list():
0 ignored issues
show
Coding Style introduced by
This function 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...
286
287
    @freeze_time("2012-01-14 12:00:01")
288
    def it_updates_the_log(config):
0 ignored issues
show
Coding Style introduced by
This function 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...
289
        gitman.install()
290
        gitman.list()
291
        with open(config.log_path) as stream:
292
            contents = stream.read().replace("/private", "")
293
294
        temp_path = os.path.normpath(tempfile.gettempdir())
295
        test_string = (
296
            "2012-01-14 12:00:01\n" +
297
            temp_path + os.path.normpath("/gitman-shared/deps/gitman_1") + ": https://github.com/jacebrowning/gitman-demo @ 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd\n" +
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (169/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
298
            temp_path + os.path.normpath("/gitman-shared/deps/gitman_1/gitman_sources/gdm_3") + ": https://github.com/jacebrowning/gdm-demo @ 050290bca3f14e13fd616604202b579853e7bfb0\n" +
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (187/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
299
            temp_path + os.path.normpath("/gitman-shared/deps/gitman_1/gitman_sources/gdm_3/gitman_sources/gdm_3") + ": https://github.com/jacebrowning/gdm-demo @ fb693447579235391a45ca170959b5583c5042d8\n" +
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (208/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
300
            temp_path + os.path.normpath("/gitman-shared/deps/gitman_1/gitman_sources/gdm_3/gitman_sources/gdm_4") + ": https://github.com/jacebrowning/gdm-demo @ 63ddfd82d308ddae72d31b61cb8942c898fa05b5\n" +
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (208/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
301
            temp_path + os.path.normpath("/gitman-shared/deps/gitman_1/gitman_sources/gdm_4") + ": https://github.com/jacebrowning/gdm-demo @ 63ddfd82d308ddae72d31b61cb8942c898fa05b5\n" +
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (187/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
302
            temp_path + os.path.normpath("/gitman-shared/deps/gitman_2") + ": https://github.com/jacebrowning/gitman-demo @ 7bd138fe7359561a8c2ff9d195dff238794ccc04\n" +
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (169/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
303
            temp_path + os.path.normpath("/gitman-shared/deps/gitman_3") + ": https://github.com/jacebrowning/gitman-demo @ 9bf18e16b956041f0267c21baad555a23237b52e\n"
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (167/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
304
        )
305
        expect(contents) == strip(test_string, end='\n\n')
306
307
308
def describe_lock():
0 ignored issues
show
Coding Style introduced by
This function 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...
309
310
    def it_records_all_versions_when_no_arguments(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_records_all_versions_when_no_arguments 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...
Coding Style introduced by
This function 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...
311
        expect(gitman.update(depth=1, lock=False)) == True
312
        expect(gitman.lock()) == True
313
314
        expect(config.__mapper__.text) == CONFIG + strip("""
315
        sources_locked:
316
        - name: gitman_1
317
          link: ''
318
          repo: https://github.com/jacebrowning/gitman-demo
319
          rev: 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd
320
        - name: gitman_2
321
          link: ''
322
          repo: https://github.com/jacebrowning/gitman-demo
323
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
324
        - name: gitman_3
325
          link: ''
326
          repo: https://github.com/jacebrowning/gitman-demo
327
          rev: 9bf18e16b956041f0267c21baad555a23237b52e
328
        """) == config.__mapper__.text
329
330
    def it_records_specified_dependencies(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_records_specified_dependencies 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...
Coding Style introduced by
This function 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...
331
        expect(gitman.update(depth=1, lock=False)) == True
332
        expect(gitman.lock('gitman_1', 'gitman_3')) == True
333
334
        expect(config.__mapper__.text) == CONFIG + strip("""
335
        sources_locked:
336
        - name: gitman_1
337
          link: ''
338
          repo: https://github.com/jacebrowning/gitman-demo
339
          rev: 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd
340
        - name: gitman_3
341
          link: ''
342
          repo: https://github.com/jacebrowning/gitman-demo
343
          rev: 9bf18e16b956041f0267c21baad555a23237b52e
344
        """) == config.__mapper__.text
345
346
    def it_should_fail_on_dirty_repositories(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_should_fail_on_dirty_repositories 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...
Coding Style introduced by
This function 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...
347
        expect(gitman.update(depth=1, lock=False)) == True
348
        os.remove("deps/gitman_1/.project")
349
350
        with pytest.raises(UncommittedChanges):
351
            gitman.lock()
352
353
    def it_should_fail_on_invalid_repositories(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_should_fail_on_invalid_repositories 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...
Coding Style introduced by
This function 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...
354
        os.system("mkdir deps && touch deps/gitman_1")
355
356
        with pytest.raises(InvalidRepository):
357
            gitman.lock()
358
359
        expect(config.__mapper__.text).does_not_contain("<unknown>")
360