11from datetime import datetime
22
3- from ..local_changes import FileChange , LocalPojectChanges
3+ from ..local_changes import FileChange , LocalProjectChanges
44
55
66def test_local_changes_from_dict ():
7- """Test generating LocalChanges from a dictionary."""
7+ """Test generating LocalProjectChanges from a dictionary."""
88 changes_dict = {
99 "added" : [{"path" : "file1.txt" , "checksum" : "abc123" , "size" : 1024 , "mtime" : datetime .now ()}],
1010 "updated" : [{"path" : "file2.txt" , "checksum" : "xyz789" , "size" : 2048 , "mtime" : datetime .now ()}],
@@ -35,7 +35,7 @@ def test_local_changes_from_dict():
3535 updated = [FileChange (** file ) for file in changes_dict ["updated" ]]
3636 removed = [FileChange (** file ) for file in changes_dict ["removed" ]]
3737
38- local_changes = LocalPojectChanges (added = added , updated = updated , removed = removed )
38+ local_changes = LocalProjectChanges (added = added , updated = updated , removed = removed )
3939
4040 # Assertions
4141 assert len (local_changes .added ) == 1
@@ -72,7 +72,7 @@ def test_local_changes_to_server_payload():
7272 updated = [FileChange (path = "file2.txt" , checksum = "xyz789" , size = 2048 , mtime = datetime .now ())]
7373 removed = [FileChange (path = "file3.txt" , checksum = "lmn456" , size = 512 , mtime = datetime .now ())]
7474
75- local_changes = LocalPojectChanges (added = added , updated = updated , removed = removed )
75+ local_changes = LocalProjectChanges (added = added , updated = updated , removed = removed )
7676 server_request = local_changes .to_server_payload ()
7777
7878 assert "added" in server_request
@@ -83,33 +83,33 @@ def test_local_changes_to_server_payload():
8383 assert server_request ["removed" ][0 ]["path" ] == "file3.txt"
8484
8585
86- def test_local_changes_update_chunks ():
86+ def test_local_changes_update_chunk_ids ():
8787 """Test the update_chunks method of LocalChanges."""
8888 added = [
8989 FileChange (path = "file1.txt" , checksum = "abc123" , size = 1024 , mtime = datetime .now (), chunks = ["abc123" ]),
9090 FileChange (path = "file2.txt" , checksum = "abc123" , size = 1024 , mtime = datetime .now (), chunks = ["abc123" ]),
9191 ]
9292 updated = [FileChange (path = "file2.txt" , checksum = "xyz789" , size = 2048 , mtime = datetime .now (), chunks = ["xyz789" ])]
9393
94- local_changes = LocalPojectChanges (added = added , updated = updated )
94+ local_changes = LocalProjectChanges (added = added , updated = updated )
9595 chunks = [("abc123" , "chunk1" ), ("abc123" , "chunk1" ), ("xyz789" , "chunk2" )]
9696
97- local_changes .update_chunks (chunks )
97+ local_changes .update_chunk_ids (chunks )
9898
9999 assert local_changes .added [0 ].chunks == ["chunk1" ]
100100 assert local_changes .added [1 ].chunks == ["chunk1" ]
101101 assert local_changes .updated [0 ].chunks == ["chunk2" ]
102102
103103
104104def test_local_changes_get_upload_changes ():
105- """Test the get_upload_changes method of LocalChanges ."""
105+ """Test the get_upload_changes method of LocalProjectChanges ."""
106106 # Create sample LocalChange instances
107107 added = [FileChange (path = "file1.txt" , checksum = "abc123" , size = 1024 , mtime = datetime .now ())]
108108 updated = [FileChange (path = "file2.txt" , checksum = "xyz789" , size = 2048 , mtime = datetime .now ())]
109109 removed = [FileChange (path = "file3.txt" , checksum = "lmn456" , size = 512 , mtime = datetime .now ())]
110110
111111 # Initialize LocalChanges with added, updated, and removed changes
112- local_changes = LocalPojectChanges (added = added , updated = updated , removed = removed )
112+ local_changes = LocalProjectChanges (added = added , updated = updated , removed = removed )
113113
114114 # Call get_upload_changes
115115 upload_changes = local_changes .get_upload_changes ()
0 commit comments