diff --git a/manic/checkout.py b/manic/checkout.py index 222065553..8dd1798d7 100755 --- a/manic/checkout.py +++ b/manic/checkout.py @@ -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. diff --git a/test/test_sys_checkout.py b/test/test_sys_checkout.py index c9e07cbdb..1be7cba10 100644 --- a/test/test_sys_checkout.py +++ b/test/test_sys_checkout.py @@ -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. """ @@ -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) @@ -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]]) @@ -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]]) @@ -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]]) @@ -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