From c74696036e97420cc8e786527255293605036fe2 Mon Sep 17 00:00:00 2001
From: David Douard <david.douard@sdfa3.org>
Date: Wed, 11 Mar 2020 15:39:32 +0100
Subject: [PATCH] tests/models: use d.copy() instead of dict(d)

for better clarity on the code author's intention.
---
 swh/model/tests/test_model.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/swh/model/tests/test_model.py b/swh/model/tests/test_model.py
index 8bffa80b..359bb082 100644
--- a/swh/model/tests/test_model.py
+++ b/swh/model/tests/test_model.py
@@ -259,7 +259,7 @@ def test_skipped_content_from_data(data):
 
 
 def test_directory_model_id_computation():
-    dir_dict = dict(directory_example)
+    dir_dict = directory_example.copy()
     del dir_dict['id']
 
     dir_id = hash_to_bytes(directory_identifier(dir_dict))
@@ -268,7 +268,7 @@ def test_directory_model_id_computation():
 
 
 def test_revision_model_id_computation():
-    rev_dict = dict(revision_example)
+    rev_dict = revision_example.copy()
     del rev_dict['id']
 
     rev_id = hash_to_bytes(revision_identifier(rev_dict))
@@ -280,7 +280,7 @@ def test_revision_model_id_computation_with_no_date():
     """We can have revision with date to None
 
     """
-    rev_dict = dict(revision_example)
+    rev_dict = revision_example.copy()
     rev_dict['date'] = None
     rev_dict['committer_date'] = None
     del rev_dict['id']
@@ -293,7 +293,7 @@ def test_revision_model_id_computation_with_no_date():
 
 
 def test_release_model_id_computation():
-    rel_dict = dict(release_example)
+    rel_dict = release_example.copy()
     del rel_dict['id']
 
     rel_id = hash_to_bytes(release_identifier(rel_dict))
@@ -302,7 +302,7 @@ def test_release_model_id_computation():
 
 
 def test_snapshot_model_id_computation():
-    snp_dict = dict(snapshot_example)
+    snp_dict = snapshot_example.copy()
     del snp_dict['id']
 
     snp_id = hash_to_bytes(snapshot_identifier(snp_dict))
-- 
GitLab