Commit 79439a13 authored by Xavier Thompson's avatar Xavier Thompson

test_slapproxy: Test request scope

parent 733b31a3
...@@ -563,16 +563,16 @@ class TestRequest(MasterMixin): ...@@ -563,16 +563,16 @@ class TestRequest(MasterMixin):
def test_two_request_one_partition_free(self): def test_two_request_one_partition_free(self):
""" """
Since slapproxy does not implement scope, providing two partition_id Since slapproxy implements scope, providing two partition_id
values will still succeed, even if only one partition is available. values will fail when only one partition is available.
""" """
self.format_for_number_of_partitions(1) self.format_for_number_of_partitions(1)
self.assertIsInstance(self.request('http://sr//', None, self.assertIsInstance(self.request('http://sr//', None,
'MyFirstInstance', 'slappart2'), 'MyFirstInstance', 'slappart2'),
slapos.slap.ComputerPartition) slapos.slap.ComputerPartition)
self.assertIsInstance(self.request('http://sr//', None, rv = self._requestComputerPartition('http://sr//', None,
'MyFirstInstance', 'slappart3'), 'MyFirstInstance', 'slappart3')
slapos.slap.ComputerPartition) self.assertEqual(rv._status_code, 404)
def test_two_request_two_partition_free(self): def test_two_request_two_partition_free(self):
""" """
...@@ -754,13 +754,13 @@ class TestRequest(MasterMixin): ...@@ -754,13 +754,13 @@ class TestRequest(MasterMixin):
def test_two_different_request_from_two_partition(self): def test_two_different_request_from_two_partition(self):
""" """
Since slapproxy does not implement scope, two request with Since slapproxy implement scope, two request with
different partition_id will still return the same partition. different partition_id will return different partitions.
""" """
self.format_for_number_of_partitions(2) self.format_for_number_of_partitions(2)
self.assertEqual( self.assertNotEqual(
dict(self.request('http://sr//', None, 'MyFirstInstance', 'slappart2').__dict__, _connection_helper=None), self.request('http://sr//', None, 'MyFirstInstance', 'slappart2').getId(),
dict(self.request('http://sr//', None, 'MyFirstInstance', 'slappart3').__dict__, _connection_helper=None)) self.request('http://sr//', None, 'MyFirstInstance', 'slappart3').getId())
def test_two_different_request_from_one_partition(self): def test_two_different_request_from_one_partition(self):
""" """
...@@ -769,8 +769,8 @@ class TestRequest(MasterMixin): ...@@ -769,8 +769,8 @@ class TestRequest(MasterMixin):
""" """
self.format_for_number_of_partitions(2) self.format_for_number_of_partitions(2)
self.assertNotEqual( self.assertNotEqual(
self.request('http://sr//', None, 'MyFirstInstance', 'slappart2').__dict__, self.request('http://sr//', None, 'MyFirstInstance', 'slappart2').getId(),
self.request('http://sr//', None, 'frontend', 'slappart2').__dict__) self.request('http://sr//', None, 'frontend', 'slappart2').getId())
def test_request_with_nonascii_parameters(self): def test_request_with_nonascii_parameters(self):
""" """
......
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