Skip to content
Snippets Groups Projects
Commit de86eb73 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

extra unit tests

parent 7ad8210f
No related branches found
No related tags found
No related merge requests found
......@@ -159,7 +159,10 @@ cdef class TimeSeries:
raise Corruption('Detected invalid file "%s"' % (filename, ))
self.chunks.sort()
last_chunk_name, is_direct, is_gzip = self.chunks[-1]
try:
last_chunk_name, is_direct, is_gzip = self.chunks[-1]
except IndexError as e:
raise Corruption('Corrupted series: %s' % (e, )) from e
self.last_chunk = self.open_chunk(last_chunk_name, is_direct, is_gzip)
self.last_entry_ts = self.last_chunk.max_ts
......
......@@ -32,7 +32,7 @@ class TestSeries(unittest.TestCase):
series = create_series('test10', 'test10', 10, 4096)
series.close()
write_json_to_file('test10/metadata.txt', {})
self.assertRaises(Corruption, TimeSeries('test10', 'test10'))
self.assertRaises(Corruption, lambda: TimeSeries('test10', 'test10'))
def test_trim_multiple_chunks_with_close(self):
from tempsdb.series import create_series, TimeSeries
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment