Merge lp:~elopio/cloudspacesclient/ignore_versions into lp:cloudspacesclient

Proposed by Leo Arias
Status: Merged
Merged at revision: 42
Proposed branch: lp:~elopio/cloudspacesclient/ignore_versions
Merge into: lp:cloudspacesclient
Diff against target: 103 lines (+11/-22)
1 file modified
src/cloudspacesclient/tests/conformance/test_cloudspaces_api.py (+11/-22)
To merge this branch: bzr merge lp:~elopio/cloudspacesclient/ignore_versions
Reviewer Review Type Date Requested Status
Richard Huddie (community) Approve
Review via email: mp+198082@code.launchpad.net

Commit message

Do not check the versions on the conformance tests.
Do not check the creation date of the first version of the file on the edit test.

Description of the change

I have a test that uploads a file and checks the server modified time, so we don't need it in this test. I'll make sure to propose it before leaving today.

To post a comment you must log in.
Revision history for this message
Richard Huddie (rhuddie) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/cloudspacesclient/tests/conformance/test_cloudspaces_api.py'
2--- src/cloudspacesclient/tests/conformance/test_cloudspaces_api.py 2013-12-06 15:02:38 +0000
3+++ src/cloudspacesclient/tests/conformance/test_cloudspaces_api.py 2013-12-06 15:29:27 +0000
4@@ -99,20 +99,20 @@
5
6 class TestCaseWithRootNodeInfo(BaseCloudspacesAPITestCase):
7
8+ # We never check the version number on the tests because it depends on the
9+ # server implementation. It not necessarily starts in 1, and increase by 1
10+ # on every change.
11+
12 def setUp(self):
13 super(TestCaseWithRootNodeInfo, self).setUp()
14 self.root_node_id = self._get_root_node_id()
15
16 def _get_root_node_id(self):
17 user_rep = self.cloudspaces_api_client.get_user_representation()
18- root_volume = self._get_root_volume(user_rep.get('volumes'))
19+ # Just use the first volume for the tests.
20+ root_volume = user_rep.get('volumes')[0]
21 return root_volume.get('node_id')
22
23- def _get_root_volume(self, volumes):
24- # FIXME The first volume returned is not necessarily the root.
25- # --elopio - 2013-11-23
26- return volumes[0]
27-
28 def test_get_root_metadata(self):
29 metadata = self.cloudspaces_api_client.get_metadata(self.root_node_id)
30
31@@ -197,7 +197,7 @@
32 root_path = self.test_server.get_root_path()
33 expected = dict(
34 is_folder=True, is_deleted=False, is_root=False, path=root_path,
35- filename=folder_name, parent_node_id=self.root_node_id, version=1)
36+ filename=folder_name, parent_node_id=self.root_node_id)
37 self._assert_json_object_values(expected, metadata)
38
39 def test_create_folder_no_parent_id(self):
40@@ -213,7 +213,7 @@
41 root_path = self.test_server.get_root_path()
42 expected = dict(
43 is_folder=True, is_deleted=False, is_root=False, path=root_path,
44- filename=folder_name, parent_node_id=self.root_node_id, version=1)
45+ filename=folder_name, parent_node_id=self.root_node_id)
46 self._assert_json_object_values(expected, metadata)
47
48 def test_create_child_folder(self):
49@@ -235,7 +235,7 @@
50
51 expected = dict(
52 is_folder=True, is_deleted=False, is_root=False,
53- path=child_folder_path, filename=child_folder_name, version=2)
54+ path=child_folder_path, filename=child_folder_name)
55 self._assert_json_object_values(expected, metadata)
56
57 def test_create_new_file(self):
58@@ -252,8 +252,7 @@
59 expected = dict(
60 hash=None, filename=test_file_name, is_deleted=False,
61 is_folder=False, mimetype=test_file_mimetype,
62- parent_node_id=self.root_node_id, path=root_path, size=0,
63- version=1)
64+ parent_node_id=self.root_node_id, path=root_path, size=0)
65 self._assert_json_object_values(expected, metadata)
66
67 # Assert that the file has just been created.
68@@ -287,8 +286,6 @@
69 delete_metadata = self.cloudspaces_api_client.delete(file_node_id)
70
71 root_path = self.test_server.get_root_path()
72- # We don't check the version of the file after it is deleted, as it
73- # depends on the provider's implementation.
74 expected = dict(
75 hash=None, filename=test_file_name, is_deleted=True,
76 is_folder=False, mimetype=test_file_mimetype,
77@@ -317,7 +314,7 @@
78 root_path = self.test_server.get_root_path()
79 expected = dict(
80 is_folder=True, is_deleted=True, is_root=False,
81- path=root_path, filename=folder_name, version=2)
82+ path=root_path, filename=folder_name)
83 self._assert_json_object_values(expected, metadata)
84
85 def test_delete_non_existent_object(self):
86@@ -445,17 +442,9 @@
87 # load version 1 of the file
88 metadata = self.cloudspaces_api_client.put_file(
89 file_node_id, content_v1)
90- # check correct version
91- self.assertEqual(metadata.get('version'), 2)
92- # Assert that the file has just been created.
93- self.assert_datetime_limits(
94- parser.parse(metadata.get('server_modified')), self.start_datetime,
95- self._get_now_datetime())
96 # load version 2 of the file
97 metadata = self.cloudspaces_api_client.put_file(
98 file_node_id, content_v2)
99- # check correct version
100- self.assertEqual(metadata.get('version'), 3)
101 # Assert that the file has just been updated.
102 self.assert_datetime_limits(
103 parser.parse(metadata.get('server_modified')), self.start_datetime,

Subscribers

People subscribed via source and target branches

to all changes: