File: fake_system.py

package info (click to toggle)
trash-cli 0.24.5.26-0.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,972 kB
  • sloc: python: 9,789; sh: 121; makefile: 11
file content (15 lines) | stat: -rw-r--r-- 365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class FakeSystem:
    def __init__(self):
        self.clean = False
        self.os_system_calls = []

    def set_dirty(self):
        self.clean = False

    def set_clean(self):
        self.clean = True

    def os_system(self, cmd):
        self.os_system_calls.append(cmd)
        if cmd == 'git diff-index --quiet HEAD' and self.clean:
            return 0