Definition at line 108 of file test-lz4-list.py.
◆ setUpClass()
def test-lz4-list.TestVerbose.setUpClass |
( |
|
self | ) |
|
Definition at line 110 of file test-lz4-list.py.
110 def setUpClass(self):
115 output =
execute(
"{} --list -m -v {}/test_list_concat-all.lz4 {}/test_list_*M-lz4f-2f--content-size.lz4".format(LZ4, TEMP, TEMP), print_output=
True)
116 for i, line
in enumerate(output):
117 if line.startswith(
"test_list"):
118 if start != 0
and end != 0:
119 self.vinfo_list.
append(VerboseFileInfo(output[start:end]))
123 self.vinfo_list.
append(VerboseFileInfo(output[start:end]))
125 concat_file_list = glob.glob(
"/tmp/test_list_[!concat]*.lz4")
127 for i, filename
in enumerate(concat_file_list):
128 if "2f--content-size" in filename:
129 concat_file_list.insert(i, filename)
131 self.cvinfo = self.vinfo_list[0]
132 self.cvinfo.file_frame_map = concat_file_list
133 self.cvinfo.compressed_size = os.path.getsize(
"{}/test_list_concat-all.lz4".format(TEMP))
def execute(command, print_command=True, print_output=False, print_error=True, param_shell=True)
◆ test_block()
def test-lz4-list.TestVerbose.test_block |
( |
|
self | ) |
|
Definition at line 153 of file test-lz4-list.py.
153 def test_block(self):
154 for i, frame_info
in enumerate(self.cvinfo.frame_list):
155 if "--BD" in self.cvinfo.file_frame_map[i]:
156 self.assertRegex(self.cvinfo.frame_list[i][
"block"],
"^B[0-9]+D$", self.cvinfo.frame_list[i][
"line"])
157 elif "--BI" in self.cvinfo.file_frame_map[i]:
158 self.assertEqual(self.cvinfo.frame_list[i][
"block"],
"^B[0-9]+I$", self.cvinfo.frame_list[i][
"line"])
References test-lz4-list.TestVerbose.cvinfo.
◆ test_checksum()
def test-lz4-list.TestVerbose.test_checksum |
( |
|
self | ) |
|
Definition at line 160 of file test-lz4-list.py.
160 def test_checksum(self):
161 for i, frame_info
in enumerate(self.cvinfo.frame_list):
162 if "-lz4f-" in self.cvinfo.file_frame_map[i]
and "--no-frame-crc" not in self.cvinfo.file_frame_map[i]:
163 self.assertEqual(self.cvinfo.frame_list[i][
"checksum"],
"XXH32", self.cvinfo.frame_list[i][
"line"])
References test-lz4-list.TestVerbose.cvinfo.
◆ test_compressed()
def test-lz4-list.TestVerbose.test_compressed |
( |
|
self | ) |
|
Definition at line 165 of file test-lz4-list.py.
165 def test_compressed(self):
167 for i, frame_info
in enumerate(self.cvinfo.frame_list):
168 if "-2f-" not in self.cvinfo.file_frame_map[i]:
169 expected_size = os.path.getsize(self.cvinfo.file_frame_map[i])
170 self.assertEqual(self.cvinfo.frame_list[i][
"compressed"],
str(expected_size), self.cvinfo.frame_list[i][
"line"])
171 total +=
int(self.cvinfo.frame_list[i][
"compressed"])
172 self.assertEqual(total, self.cvinfo.compressed_size,
"Expected total sum ({}) to match {} filesize".format(total, self.cvinfo.filename))
References test-lz4-list.TestVerbose.cvinfo, int, and cmd_descs_generate.str.
◆ test_filename()
def test-lz4-list.TestVerbose.test_filename |
( |
|
self | ) |
|
◆ test_frame_number()
def test-lz4-list.TestVerbose.test_frame_number |
( |
|
self | ) |
|
◆ test_frame_type()
def test-lz4-list.TestVerbose.test_frame_type |
( |
|
self | ) |
|
Definition at line 144 of file test-lz4-list.py.
144 def test_frame_type(self):
145 for i, frame_info
in enumerate(self.cvinfo.frame_list):
146 if "-lz4f-" in self.cvinfo.file_frame_map[i]:
147 self.assertEqual(self.cvinfo.frame_list[i][
"type"],
"LZ4Frame", self.cvinfo.frame_list[i][
"line"])
148 elif "-legc-" in self.cvinfo.file_frame_map[i]:
149 self.assertEqual(self.cvinfo.frame_list[i][
"type"],
"LegacyFrame", self.cvinfo.frame_list[i][
"line"])
150 elif "-skip-" in self.cvinfo.file_frame_map[i]:
151 self.assertEqual(self.cvinfo.frame_list[i][
"type"],
"SkippableFrame", self.cvinfo.frame_list[i][
"line"])
References test-lz4-list.TestVerbose.cvinfo.
◆ test_ratio()
def test-lz4-list.TestVerbose.test_ratio |
( |
|
self | ) |
|
Definition at line 181 of file test-lz4-list.py.
181 def test_ratio(self):
182 for i, frame_info
in enumerate(self.cvinfo.frame_list):
183 if "--content-size" in self.cvinfo.file_frame_map[i]:
184 self.assertEqual(self.cvinfo.frame_list[i][
'ratio'],
185 "{:.2f}%".format(
float(self.cvinfo.frame_list[i][
'compressed']) /
float(self.cvinfo.frame_list[i][
'uncompressed']) * 100),
186 self.cvinfo.frame_list[i][
"line"])
References test-lz4-list.TestVerbose.cvinfo, and test-lz4-speed.float.
◆ test_uncompressed()
def test-lz4-list.TestVerbose.test_uncompressed |
( |
|
self | ) |
|
Definition at line 174 of file test-lz4-list.py.
174 def test_uncompressed(self):
175 for i, frame_info
in enumerate(self.cvinfo.frame_list):
176 ffm = self.cvinfo.file_frame_map[i]
177 if "-2f-" not in ffm
and "--content-size" in ffm:
178 expected_size_unc =
int(ffm[ffm.rindex(
"_") + 1:ffm.index(
"M")]) * 1048576
179 self.assertEqual(self.cvinfo.frame_list[i][
"uncompressed"],
str(expected_size_unc), self.cvinfo.frame_list[i][
"line"])
References test-lz4-list.TestVerbose.cvinfo, int, and cmd_descs_generate.str.
◆ cvinfo
test-lz4-list.TestVerbose.cvinfo |
◆ vinfo_list
test-lz4-list.TestVerbose.vinfo_list |
The documentation for this class was generated from the following file: