aboutsummaryrefslogtreecommitdiff
path: root/rh/config_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'rh/config_test.py')
-rwxr-xr-xrh/config_test.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/rh/config_test.py b/rh/config_test.py
index 80fc832..df3afb6 100755
--- a/rh/config_test.py
+++ b/rh/config_test.py
@@ -27,25 +27,25 @@ REPO_ROOT = os.path.dirname(os.path.dirname(REPOTOOLS))
def assertEqual(msg, exp, actual):
"""Assert |exp| equals |actual|."""
- assert exp == actual, '%s: expected "%s" but got "%s"' % (msg, exp, actual)
+ assert exp == actual, f'{msg}: expected "{exp}" but got "{actual}"'
def assertEnv(var, value):
"""Assert |var| is set in the environment as |value|."""
- assert var in os.environ, '$%s missing in environment' % (var,)
- assertEqual('env[%s]' % (var,), value, os.environ[var])
+ assert var in os.environ, f'${var} missing in environment'
+ assertEqual(f'env[{var}]', value, os.environ[var])
def check_commit_id(commit):
"""Check |commit| looks like a git commit id."""
- assert len(commit) == 40, 'commit "%s" must be 40 chars' % (commit,)
+ assert len(commit) == 40, f'commit "{commit}" must be 40 chars'
assert re.match(r'^[a-f0-9]+$', commit), \
- 'commit "%s" must be all hex' % (commit,)
+ f'commit "{commit}" must be all hex'
def check_commit_msg(msg):
"""Check the ${PREUPLOAD_COMMIT_MESSAGE} setting."""
- assert len(msg) > 1, 'commit message must be at least 2 bytes: %s'
+ assert len(msg) > 1, f'commit message must be at least 2 bytes: {msg}'
def check_repo_root(root):
@@ -100,7 +100,7 @@ def main(argv):
check_repo_root(opts.repo_root)
check_files(opts.files)
except AssertionError as e:
- print('error: %s' % (e,), file=sys.stderr)
+ print(f'error: {e}', file=sys.stderr)
return 1
return 0