Esempio n. 1
0
 def test_update_uri(self):
     """Test that when passed, a uri overrides the entry's edit link"""
     client = gdata.client.GDClient()
     client.http_client = atom.mock_http_core.SettableHttpClient(200, "OK", gdata.data.GDEntry().ToString(), {})
     entry = gdata.data.GDEntry()
     entry.link.append(atom.data.Link(rel="edit", href="https://example.com/edit"))
     response = client.update(entry, uri="https://example.com/test")
     self.assertEqual(str(client.http_client.last_request.uri), "https://example.com/test")
Esempio n. 2
0
 def test_update_uri_editlink(self):
     """Test that the PUT uri is grabbed from the entry's edit link"""
     client = gdata.client.GDClient()
     client.http_client = atom.mock_http_core.SettableHttpClient(200, "OK", gdata.data.GDEntry().ToString(), {})
     entry = gdata.data.GDEntry()
     entry.link.append(atom.data.Link(rel="edit", href="https://example.com/edit"))
     response = client.update(entry)
     request = client.http_client.last_request
     self.assertEqual(str(client.http_client.last_request.uri), "https://example.com/edit")
Esempio n. 3
0
 def test_update_uri(self):
     """Test that when passed, a uri overrides the entry's edit link"""
     client = gdata.client.GDClient()
     client.http_client = atom.mock_http_core.SettableHttpClient(
         200, 'OK', gdata.data.GDEntry().ToString(), {})
     entry = gdata.data.GDEntry()
     entry.link.append(atom.data.Link(rel='edit', href='https://example.com/edit'))
     response = client.update(entry, uri='https://example.com/test')
     self.assertEqual(str(client.http_client.last_request.uri),
                      'https://example.com/test')
Esempio n. 4
0
 def test_update_uri_editlink(self):
     """Test that the PUT uri is grabbed from the entry's edit link"""
     client = gdata.client.GDClient()
     client.http_client = atom.mock_http_core.SettableHttpClient(
         200, 'OK', gdata.data.GDEntry().ToString(), {})
     entry = gdata.data.GDEntry()
     entry.link.append(atom.data.Link(rel='edit', href='https://example.com/edit'))
     response = client.update(entry)
     request = client.http_client.last_request
     self.assertEqual(str(client.http_client.last_request.uri),
                      'https://example.com/edit')