doorstop.core.vcs.mockvcs.WorkingCopy.edit()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
nop 2
crap 1
1
# SPDX-License-Identifier: LGPL-3.0-only
2 1
3
"""Plug-in module to simulate the storage of requirements in a repository."""
4 1
import os
5 1
6
from doorstop import common
7 1
from doorstop.core.vcs.base import BaseWorkingCopy
8
9
log = common.logger(__name__)
10 1
11
12
class WorkingCopy(BaseWorkingCopy):
13 1
    """Simulated working copy."""
14
15 1
    DIRECTORY = '.mockvcs'
16 1
17 1
    def __init__(self, path):
18
        super().__init__(path)
19 1
        self._ignores_cache = ["*/env/*", "*/apidocs/*", "*/build/lib/*"]
20
21
    def lock(self, path):
22 1
        log.debug("$ simulated lock on: {}...".format(path))
23 1
24
    def edit(self, path):
25 1
        log.debug("$ simulated edit on: {}...".format(path))
26 1
27
    def add(self, path):
28 1
        log.debug("$ simulated add on: {}...".format(path))
29 1
30 1
    def delete(self, path):
31
        os.remove(path)
32 1
        log.debug("$ Deleted {}...".format(path))
33
34
    def commit(self, message=None):
35
        log.debug("$ simulated commit")
36