Add functional test for repeated SLO segments
Currently fails on master, passes with change If13af444ed301ebd8fd34a0d96a330ded648f0c4 applied. Change-Id: I05b231cc232d5b4117bccee40eebc7093114c61c
This commit is contained in:
parent
620edc631b
commit
73ded056af
@ -2645,6 +2645,17 @@ class TestSloEnv(object):
|
|||||||
'size_bytes': None},
|
'size_bytes': None},
|
||||||
]), parms={'multipart-manifest': 'put'})
|
]), parms={'multipart-manifest': 'put'})
|
||||||
|
|
||||||
|
file_item = cls.container.file("ranged-manifest-repeated-segment")
|
||||||
|
file_item.write(
|
||||||
|
json.dumps([
|
||||||
|
{'path': seg_info['seg_a']['path'], 'etag': None,
|
||||||
|
'size_bytes': None, 'range': '-1048578'},
|
||||||
|
{'path': seg_info['seg_a']['path'], 'etag': None,
|
||||||
|
'size_bytes': None},
|
||||||
|
{'path': seg_info['seg_b']['path'], 'etag': None,
|
||||||
|
'size_bytes': None, 'range': '-1048578'},
|
||||||
|
]), parms={'multipart-manifest': 'put'})
|
||||||
|
|
||||||
|
|
||||||
class TestSlo(Base):
|
class TestSlo(Base):
|
||||||
env = TestSloEnv
|
env = TestSloEnv
|
||||||
@ -2694,6 +2705,15 @@ class TestSlo(Base):
|
|||||||
('c', 1),
|
('c', 1),
|
||||||
('d', 1)], grouped_file_contents)
|
('d', 1)], grouped_file_contents)
|
||||||
|
|
||||||
|
def test_slo_get_ranged_manifest_repeated_segment(self):
|
||||||
|
file_item = self.env.container.file('ranged-manifest-repeated-segment')
|
||||||
|
grouped_file_contents = [
|
||||||
|
(char, sum(1 for _char in grp))
|
||||||
|
for char, grp in itertools.groupby(file_item.read())]
|
||||||
|
self.assertEqual(
|
||||||
|
[('a', 2097152), ('b', 1048576)],
|
||||||
|
grouped_file_contents)
|
||||||
|
|
||||||
def test_slo_get_ranged_submanifest(self):
|
def test_slo_get_ranged_submanifest(self):
|
||||||
file_item = self.env.container.file('ranged-submanifest')
|
file_item = self.env.container.file('ranged-submanifest')
|
||||||
grouped_file_contents = [
|
grouped_file_contents = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user