Completed
Pull Request — develop (#144)
by Jace
02:23
created

it_records_specified_dependencies()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
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
8
import pytest
9
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...
10
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...
11
12
import gitman
13
from gitman import shell
14
from gitman.models import Config
15
from gitman.exceptions import UncommittedChanges, InvalidRepository
16
17
from .utilities import strip
18
19
20
ROOT = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'tmp')
21
22
CONFIG = """
23
location: deps
24
sources:
25
- name: gitman_1
26
  link: ''
27
  repo: https://github.com/jacebrowning/gitman-demo
28
  rev: example-branch
29
- name: gitman_2
30
  link: ''
31
  repo: https://github.com/jacebrowning/gitman-demo
32
  rev: example-tag
33
- name: gitman_3
34
  link: ''
35
  repo: https://github.com/jacebrowning/gitman-demo
36
  rev: 9bf18e16b956041f0267c21baad555a23237b52e
37
""".lstrip()
38
39
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...
40
41
42
@pytest.fixture
43
def 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...
44
    log.info("Temporary directory: %s", ROOT)
45
46
    with suppress(FileNotFoundError, PermissionError):
47
        shutil.rmtree(ROOT)
48
    with suppress(FileExistsError):
49
        os.makedirs(ROOT)
50
    os.chdir(ROOT)
51
52
    os.system("touch .git")
53
    config = Config(root=ROOT)
54
    config.__mapper__.text = CONFIG
0 ignored issues
show
Bug introduced by
The Instance of Config does not seem to have a member named __mapper__.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
55
56
    log.debug("File listing: %s", os.listdir(ROOT))
57
58
    return config
59
60
61
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...
62
63
    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...
64
        shell.rm(config.location)
65
66
        expect(gitman.install('gitman_1', depth=1)) == True
67
68
        expect(os.listdir(config.location)) == ['gitman_1']
69
70
    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...
71
        expect(gitman.install('gitman_1', depth=1)) == True
72
73
        expect(config.__mapper__.text) == CONFIG
74
75
    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...
76
        config.__mapper__.text = strip("""
77
        location: deps
78
        sources:
79
        - name: gitman_1
80
          link: ''
81
          repo: https://github.com/jacebrowning/gitman-demo
82
          rev: example-branch
83
        sources_locked:
84
        - name: gitman_2
85
          link: ''
86
          repo: https://github.com/jacebrowning/gitman-demo
87
          rev: example-branch
88
        - name: gitman_3
89
          link: ''
90
          repo: https://github.com/jacebrowning/gitman-demo
91
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
92
        """)
93
94
        expect(gitman.install(depth=1)) == True
95
96
        expect(len(os.listdir(config.location))) == 3
97
98
    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...
99
        config.__mapper__.text = strip("""
100
        location: deps
101
        sources:
102
        - name: gitman_1
103
          link: ''
104
          repo: https://github.com/jacebrowning/gitman-demo
105
          rev: example-branch
106
        sources_locked:
107
        - name: gitman_2
108
          link: ''
109
          repo: https://github.com/jacebrowning/gitman-demo
110
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
111
        """)
112
113
        expect(gitman.install('gitman_1', depth=1)) == True
114
115
        expect(os.listdir(config.location)) == ['gitman_1']
116
117
    def it_detects_invalid_repositories(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...
118
        shell.rm(os.path.join("deps", "gitman_1", ".git"))
119
        shell.mkdir(os.path.join("deps", "gitman_1", ".git"))
120
121
        try:
122
            with pytest.raises(InvalidRepository):
123
                expect(gitman.install('gitman_1', depth=1)) == False
124
125
        finally:
126
            shell.rm(os.path.join("deps", "gitman_1"))
127
128
    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...
129
130
        @pytest.fixture
131
        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...
132
            config.__mapper__.text = strip("""
133
            location: deps
134
            sources:
135
            - name: gitman_1
136
              link: my_link
137
              repo: https://github.com/jacebrowning/gitman-demo
138
              rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
139
            """)
140
141
            return config
142
143
        @pytest.mark.xfail(os.name == 'nt', reason="No symlinks on Windows")
144
        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...
145
            expect(gitman.install(depth=1)) == True
146
147
            expect(os.listdir()).contains('my_link')
148
149
        @pytest.mark.xfail(os.name == 'nt', reason="No symlinks on Windows")
150
        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...
151
            os.system("touch my_link")
152
153
            with pytest.raises(RuntimeError):
154
                gitman.install(depth=1)
155
156
        @pytest.mark.xfail(os.name == 'nt', reason="No symlinks on Windows")
157
        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...
158
            os.system("touch my_link")
159
160
            expect(gitman.install(depth=1, force=True)) == True
161
162
163
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...
164
165
    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...
166
        gitman.install('gitman_1', depth=1)
167
        expect(os.path.isdir(config.location)) == True
168
169
        expect(gitman.uninstall()) == True
170
171
        expect(os.path.exists(config.location)) == False
172
173
    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...
174
        expect(os.path.isdir(config.location)) == False
175
176
        expect(gitman.uninstall()) == True
177
178
    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...
179
        gitman.install('gitman_1', depth=1)
180
        gitman.list()
181
        expect(os.path.exists(config.log_path)) == True
182
183
        gitman.uninstall()
184
        expect(os.path.exists(config.log_path)) == False
185
186
187
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...
188
189
    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...
190
        gitman.update('gitman_1', depth=1)
191
192
        expect(config.__mapper__.text) == CONFIG
193
194
    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...
195
        config.__mapper__.text = strip("""
196
        location: deps
197
        sources:
198
        - name: gitman_1
199
          link: ''
200
          repo: https://github.com/jacebrowning/gitman-demo
201
          rev: example-branch
202
        - name: gitman_2
203
          link: ''
204
          repo: https://github.com/jacebrowning/gitman-demo
205
          rev: example-tag
206
        sources_locked:
207
        - name: gitman_2
208
          link: ''
209
          repo: https://github.com/jacebrowning/gitman-demo
210
          rev: (old revision)
211
        """)
212
213
        gitman.update(depth=1)
214
215
        expect(config.__mapper__.text) == strip("""
216
        location: deps
217
        sources:
218
        - name: gitman_1
219
          link: ''
220
          repo: https://github.com/jacebrowning/gitman-demo
221
          rev: example-branch
222
        - name: gitman_2
223
          link: ''
224
          repo: https://github.com/jacebrowning/gitman-demo
225
          rev: example-tag
226
        sources_locked:
227
        - name: gitman_2
228
          link: ''
229
          repo: https://github.com/jacebrowning/gitman-demo
230
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
231
        """)
232
233
    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...
234
        config.__mapper__.text = strip("""
235
        location: deps
236
        sources:
237
        - name: gitman_1
238
          link: ''
239
          repo: https://github.com/jacebrowning/gitman-demo
240
          rev: example-branch
241
        - name: gitman_2
242
          link: ''
243
          repo: https://github.com/jacebrowning/gitman-demo
244
          rev: example-tag
245
        sources_locked:
246
        - name: gitman_2
247
          link: ''
248
          repo: https://github.com/jacebrowning/gitman-demo
249
          rev: (old revision)
250
        """)
251
252
        gitman.update(depth=1, lock=False)
253
254
        expect(config.__mapper__.text) == strip("""
255
        location: deps
256
        sources:
257
        - name: gitman_1
258
          link: ''
259
          repo: https://github.com/jacebrowning/gitman-demo
260
          rev: example-branch
261
        - name: gitman_2
262
          link: ''
263
          repo: https://github.com/jacebrowning/gitman-demo
264
          rev: example-tag
265
        sources_locked:
266
        - name: gitman_2
267
          link: ''
268
          repo: https://github.com/jacebrowning/gitman-demo
269
          rev: (old revision)
270
        """)
271
272
    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...
273
        gitman.update(depth=1, lock=True)
274
275
        expect(config.__mapper__.text) == CONFIG + strip("""
276
        sources_locked:
277
        - name: gitman_1
278
          link: ''
279
          repo: https://github.com/jacebrowning/gitman-demo
280
          rev: 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd
281
        - name: gitman_2
282
          link: ''
283
          repo: https://github.com/jacebrowning/gitman-demo
284
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
285
        - name: gitman_3
286
          link: ''
287
          repo: https://github.com/jacebrowning/gitman-demo
288
          rev: 9bf18e16b956041f0267c21baad555a23237b52e
289
        """)
290
291
292
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...
293
294
    @freeze_time("2012-01-14 12:00:01")
295
    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...
296
        gitman.install()
297
        gitman.list()
298
299
        with open(config.log_path) as stream:
300
            contents = stream.read().replace(ROOT, "tmp").replace('\\', '/')
301
        expect(contents) == strip("""
302
        2012-01-14 12:00:01
303
        tmp/deps/gitman_1: https://github.com/jacebrowning/gitman-demo @ 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd
304
        tmp/deps/gitman_1/gitman_sources/gdm_3: https://github.com/jacebrowning/gdm-demo @ 050290bca3f14e13fd616604202b579853e7bfb0
305
        tmp/deps/gitman_1/gitman_sources/gdm_3/gitman_sources/gdm_3: https://github.com/jacebrowning/gdm-demo @ fb693447579235391a45ca170959b5583c5042d8
306
        tmp/deps/gitman_1/gitman_sources/gdm_3/gitman_sources/gdm_4: https://github.com/jacebrowning/gdm-demo @ 63ddfd82d308ddae72d31b61cb8942c898fa05b5
307
        tmp/deps/gitman_1/gitman_sources/gdm_4: https://github.com/jacebrowning/gdm-demo @ 63ddfd82d308ddae72d31b61cb8942c898fa05b5
308
        tmp/deps/gitman_2: https://github.com/jacebrowning/gitman-demo @ 7bd138fe7359561a8c2ff9d195dff238794ccc04
309
        tmp/deps/gitman_3: https://github.com/jacebrowning/gitman-demo @ 9bf18e16b956041f0267c21baad555a23237b52e
310
        """, end='\n\n')
311
312
313
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...
314
315
    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...
316
        expect(gitman.update(depth=1, lock=False)) == True
317
        expect(gitman.lock()) == True
318
319
        expect(config.__mapper__.text) == CONFIG + strip("""
320
        sources_locked:
321
        - name: gitman_1
322
          link: ''
323
          repo: https://github.com/jacebrowning/gitman-demo
324
          rev: 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd
325
        - name: gitman_2
326
          link: ''
327
          repo: https://github.com/jacebrowning/gitman-demo
328
          rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
329
        - name: gitman_3
330
          link: ''
331
          repo: https://github.com/jacebrowning/gitman-demo
332
          rev: 9bf18e16b956041f0267c21baad555a23237b52e
333
        """) == config.__mapper__.text
334
335
    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...
336
        expect(gitman.update(depth=1, lock=False)) == True
337
        expect(gitman.lock('gitman_1', 'gitman_3')) == True
338
339
        expect(config.__mapper__.text) == CONFIG + strip("""
340
        sources_locked:
341
        - name: gitman_1
342
          link: ''
343
          repo: https://github.com/jacebrowning/gitman-demo
344
          rev: 1de84ca1d315f81b035cd7b0ecf87ca2025cdacd
345
        - name: gitman_3
346
          link: ''
347
          repo: https://github.com/jacebrowning/gitman-demo
348
          rev: 9bf18e16b956041f0267c21baad555a23237b52e
349
        """) == config.__mapper__.text
350
351
    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...
352
        expect(gitman.update(depth=1, lock=False)) == True
353
        shell.rm(os.path.join("deps", "gitman_1", ".project"))
354
355
        try:
356
            with pytest.raises(UncommittedChanges):
357
                gitman.lock()
358
359
            expect(config.__mapper__.text).does_not_contain("<dirty>")
360
361
        finally:
362
            shell.rm(os.path.join("deps", "gitman_1"))
363
364
    def it_should_fail_on_missing_repositories(config):
0 ignored issues
show
Coding Style Naming introduced by
The name it_should_fail_on_missing_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...
365
        shell.mkdir("deps")
366
        shell.rm(os.path.join("deps", "gitman_1"))
367
368
        with pytest.raises(InvalidRepository):
369
            gitman.lock()
370
371
        expect(config.__mapper__.text).does_not_contain("<unknown>")
372
373
    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...
374
        shell.mkdir("deps")
375
        shell.rm(os.path.join("deps", "gitman_1", ".git"))
376
        shell.mkdir(os.path.join("deps", "gitman_1", ".git"))
377
378
        try:
379
            with pytest.raises(InvalidRepository):
380
                gitman.lock()
381
382
            expect(config.__mapper__.text).does_not_contain("<unknown>")
383
384
        finally:
385
            shell.rm(os.path.join("deps", "gitman_1"))
386