Skip to content

Commit a11704a

Browse files
committed
Tests and pre-commit checks passing
1 parent 5957e87 commit a11704a

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

tests/test_check.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,33 +122,33 @@ def helperCheckVerboseMismatch(self, test_name, hpss_path, zstash_path=ZSTASH_PA
122122
)
123123
os.chdir(TOP_LEVEL)
124124

125-
# def testCheck(self):
126-
# self.helperCheck("testCheck", "none")
125+
def testCheck(self):
126+
self.helperCheck("testCheck", "none")
127127

128-
# def testCheckHPSS(self):
129-
# self.conditional_hpss_skip()
130-
# self.helperCheck("testCheckHPSS", HPSS_ARCHIVE)
128+
def testCheckHPSS(self):
129+
self.conditional_hpss_skip()
130+
self.helperCheck("testCheckHPSS", HPSS_ARCHIVE)
131131

132-
# def testCheckCache(self):
133-
# self.helperCheck("testCheckCache", "none", cache="my_cache")
132+
def testCheckCache(self):
133+
self.helperCheck("testCheckCache", "none", cache="my_cache")
134134

135-
# def testCheckCacheHPSS(self):
136-
# self.conditional_hpss_skip()
137-
# self.helperCheck("testCheckCacheHPSS", HPSS_ARCHIVE, cache="my_cache")
135+
def testCheckCacheHPSS(self):
136+
self.conditional_hpss_skip()
137+
self.helperCheck("testCheckCacheHPSS", HPSS_ARCHIVE, cache="my_cache")
138138

139-
# def testCheckVerboseMismatch(self):
140-
# self.helperCheckVerboseMismatch("testCheckVerboseMismatch", "none")
139+
def testCheckVerboseMismatch(self):
140+
self.helperCheckVerboseMismatch("testCheckVerboseMismatch", "none")
141141

142-
# def testCheckVerboseMismatchHPSS(self):
143-
# self.conditional_hpss_skip()
144-
# self.helperCheckVerboseMismatch("testCheckVerboseMismatchHPSS", HPSS_ARCHIVE)
142+
def testCheckVerboseMismatchHPSS(self):
143+
self.conditional_hpss_skip()
144+
self.helperCheckVerboseMismatch("testCheckVerboseMismatchHPSS", HPSS_ARCHIVE)
145145

146-
# def testCheckTars(self):
147-
# helperCheckTars(self, "testCheckTars", "none")
146+
def testCheckTars(self):
147+
helperCheckTars(self, "testCheckTars", "none")
148148

149-
# def testCheckTarsHPSS(self):
150-
# self.conditional_hpss_skip()
151-
# helperCheckTars(self, "testCheckTarsHPSS", HPSS_ARCHIVE)
149+
def testCheckTarsHPSS(self):
150+
self.conditional_hpss_skip()
151+
helperCheckTars(self, "testCheckTarsHPSS", HPSS_ARCHIVE)
152152

153153
def testCheckKeepTars(self):
154154
"""

zstash/update.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def update_database( # noqa: C901
163163
# Eliminate files that are already archived and up to date
164164
newfiles: List[str] = []
165165
for file_path in files:
166-
#logger.debug(f"file_path={file_path}")
166+
# logger.debug(f"file_path={file_path}")
167167
statinfo: os.stat_result = os.lstat(file_path)
168168
mdtime_new: datetime = datetime.utcfromtimestamp(statinfo.st_mtime)
169169
mode: int = statinfo.st_mode
@@ -180,7 +180,7 @@ def update_database( # noqa: C901
180180
while True:
181181
# Get the corresponding row in the 'files' table
182182
match_: Optional[TupleFilesRow] = cur.fetchone()
183-
#logger.debug(f"match_={match_}")
183+
# logger.debug(f"match_={match_}")
184184
if match_ is None:
185185
break
186186
else:

zstash/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ def update_config_using_db(self, cur: sqlite3.Cursor):
115115
value = cur.fetchone()[0]
116116
# Update config with the new attribute-value pair
117117
setattr(self.config, attr, value)
118-
logger.debug(f"Updated config using db. Now, maxsize={self.config.maxsize}, path={self.config.path}, hpss={self.config.hpss}, hpss_type={self.hpss_type}")
118+
logger.debug(
119+
f"Updated config using db. Now, maxsize={self.config.maxsize}, path={self.config.path}, hpss={self.config.hpss}, hpss_type={self.hpss_type}"
120+
)
119121

120122
def get_db_name(self) -> str:
121123
return os.path.join(self.cache_dir, "index.db")

0 commit comments

Comments
 (0)