| Total Complexity | 6 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 90% |
| Changes | 0 | ||
| 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 |