Skip to content

Commit

Permalink
fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Sep 18, 2020
1 parent 7c9f3c6 commit 29e26af
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions manic/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,14 @@ def main(args):

if args.status:
# user requested status-only
for comp in sorted(tree_status.keys()):
for comp in sorted(tree_status):
tree_status[comp].log_status_message(args.verbose)
else:
# checkout / update the external repositories.
safe_to_update = check_safe_to_update_repos(tree_status)
if not safe_to_update:
# print status
for comp in sorted(tree_status.keys()):
for comp in sorted(tree_status):
tree_status[comp].log_status_message(args.verbose)
# exit gracefully
msg = """The external repositories labeled with 'M' above are not in a clean state.
Expand Down
25 changes: 13 additions & 12 deletions test/test_sys_checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def container_simple_required(self, dest_dir):

self.write_config(dest_dir)

def container_nested_required(self, dest_dir, order=[0,1,2]):
def container_nested_required(self, dest_dir, order):
"""Create a container externals file with only simple externals.
"""
Expand All @@ -174,7 +174,7 @@ def container_nested_required(self, dest_dir, order=[0,1,2]):
branch=REMOTE_BRANCH_FEATURE2, path=NESTED_NAME[order[1]])

self.create_section(SIMPLE_REPO_NAME, 'simp_hash', nested=True,
ref_hash='60b1cc1a38d63',path=NESTED_NAME[order[2]])
ref_hash='60b1cc1a38d63', path=NESTED_NAME[order[2]])

self.write_config(dest_dir)

Expand Down Expand Up @@ -794,7 +794,7 @@ def _check_container_simple_required_pre_checkout(self, overall, tree):
self._check_simple_branch_empty(tree)
self._check_simple_hash_empty(tree)

def _check_container_nested_required_pre_checkout(self, overall, tree, order=[0,1,2]):
def _check_container_nested_required_pre_checkout(self, overall, tree, order):
self.assertEqual(overall, 0)
self._check_nested_tag_empty(tree, name=NESTED_NAME[order[0]])
self._check_nested_branch_empty(tree, name=NESTED_NAME[order[1]])
Expand All @@ -807,7 +807,7 @@ def _check_container_simple_required_checkout(self, overall, tree):
self._check_simple_branch_empty(tree)
self._check_simple_hash_empty(tree)

def _check_container_nested_required_checkout(self, overall, tree, order=[0,1,2]):
def _check_container_nested_required_checkout(self, overall, tree, order):
# Note, this is the internal tree status just before checkout
self.assertEqual(overall, 0)
self._check_nested_tag_empty(tree, name=NESTED_NAME[order[0]])
Expand All @@ -820,7 +820,7 @@ def _check_container_simple_required_post_checkout(self, overall, tree):
self._check_simple_branch_ok(tree)
self._check_simple_hash_ok(tree)

def _check_container_nested_required_post_checkout(self, overall, tree, order=[0,1,2]):
def _check_container_nested_required_post_checkout(self, overall, tree, order):
self.assertEqual(overall, 0)
self._check_nested_tag_ok(tree, name=NESTED_NAME[order[0]])
self._check_nested_branch_ok(tree, name=NESTED_NAME[order[1]])
Expand Down Expand Up @@ -1029,29 +1029,30 @@ def test_container_nested_required(self):
Tests over all possible permutations
"""

orders = [[0,1,2], [1,2,0], [2,0,1], [0,2,1], [2,1,0], [1,0,2]]
orders = [[0, 1, 2], [1, 2, 0], [2, 0, 1],
[0, 2, 1], [2, 1, 0], [1, 0, 2]]
for n, order in enumerate(orders):
# create repo
dest_dir=os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT],
self._test_id,"test"+str(n))
dest_dir = os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT],
self._test_id, "test"+str(n))
under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME,
dest_dir_in=dest_dir)
self._generator.container_nested_required(under_test_dir, order=order)
self._generator.container_nested_required(under_test_dir, order)

# status of empty repo
overall, tree = self.execute_cmd_in_dir(under_test_dir,
self.status_args)
self._check_container_nested_required_pre_checkout(overall, tree, order=order)
self._check_container_nested_required_pre_checkout(overall, tree, order)

# checkout
overall, tree = self.execute_cmd_in_dir(under_test_dir,
self.checkout_args)
self._check_container_nested_required_checkout(overall, tree, order=order)
self._check_container_nested_required_checkout(overall, tree, order)

# status clean checked out
overall, tree = self.execute_cmd_in_dir(under_test_dir,
self.status_args)
self._check_container_nested_required_post_checkout(overall, tree, order=order)
self._check_container_nested_required_post_checkout(overall, tree, order)

def test_container_simple_optional(self):
"""Verify that container with an optional simple subrepos
Expand Down

0 comments on commit 29e26af

Please sign in to comment.