Commit 53cefc00 authored by Łukasz Nowak's avatar Łukasz Nowak

Drop test for removed functionality.

parent 6b0217a0
......@@ -1287,115 +1287,6 @@ class TestInstanceGETlist(VifibSlaposRestAPIV1InstanceMixin):
self.assertTrue('Bearer realm="' in auth)
self.assertPersonRequestSimulatorEmpty()
class TestGET_discovery(VifibSlaposRestAPIV1Mixin):
def afterSetUp(self):
super(TestGET_discovery, self).afterSetUp()
self.api_date = self.portal.portal_vifib_rest_api_v1.api_modification_date
def assertLastModifiedHeader(self):
self.assertEqual(
rfc1123_date(self.api_date),
self.response.getheader('Last-Modified'))
def assertAPIDiscoveryDict(self):
self.assertSameSet(self.json_response.keys(),
[
'computer_update',
'instance_certificate',
'request_instance',
'instance_list',
'instance_edit',
'instance_bang',
'instance_info',
'discovery',
])
@skip("Temporary disabled to reduce error numbers in global tests")
def test_noAcquisition(self):
# check the test
portal_id = self.portal.getId()
self.logout()
self.assertEqual(portal_id, self.portal.getId())
self.login()
# prove that even if anyone has access to portal root it is impossible
# to fetch it via API
self.connection.request(method='GET',
url='/'.join([self.api_path, self.portal.getId(), 'getId'])
)
self.prepareResponse()
self.assertResponseCode(404)
self.assertBasicResponse()
@skip("Temporary disabled to reduce error numbers in global tests")
def test(self):
self.connection.request(method='GET',
url=self.api_path)
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(200)
self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson()
self.assertAPIDiscoveryDict()
def test_if_modified_since_equal(self):
self.connection.request(method='GET',
url=self.api_path,
headers={'If-Modified-Since': rfc1123_date(self.api_date)})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(304)
@skip("Temporary disabled to reduce error numbers in global tests")
def test_if_modified_since_after(self):
if_modified = self.api_date.timeTime() + 2
# check the test: is calculated time *before* now?
self.assertTrue(int(if_modified) < int(DateTime().timeTime()))
self.connection.request(method='GET',
url=self.api_path,
headers={'If-Modified-Since': rfc1123_date(DateTime(if_modified))})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(304)
@skip("Temporary disabled to reduce error numbers in global tests")
def test_if_modified_since_before(self):
self.connection.request(method='GET',
url=self.api_path,
headers={'If-Modified-Since': rfc1123_date(self.api_date - 1)})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(200)
self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson()
self.assertAPIDiscoveryDict()
def test_if_modified_since_date_not_date(self):
self.connection.request(method='GET',
url=self.api_path,
headers={'If-Modified-Since': 'This Is Not A date'})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(200)
self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson()
self.assertAPIDiscoveryDict()
@skip("Temporary disabled to reduce error numbers in global tests")
def test_if_modified_since_date_future(self):
self.connection.request(method='GET',
url=self.api_path,
headers={'If-Modified-Since': rfc1123_date(DateTime() + 1)})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(200)
self.assertLastModifiedHeader()
self.assertCacheControlHeader()
self.assertResponseJson()
self.assertAPIDiscoveryDict()
class TestComputerPUT(VifibSlaposRestAPIV1MixinBase):
def createComputer(self):
computer = self.cloneByPath(
......
70
\ No newline at end of file
71
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment