diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 34d29ea10a9063f317bc69dec078dc66a52f2a64..0ec9352190605e47a56095796e6a87233b6a9ba5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,10 +11,17 @@ stages: - cd minijson - python setup.py install - cd .. + - rm -rf minijson - pip install -r requirements.txt + - python setup.py build_ext --inplace + variables: + CI: "1" script: - - python setup.py test + - python -m coverage run -m nose2 -vv -F + - python -m coverage report + + test_python38: extends: .test_python - image: python:3.8 \ No newline at end of file + image: python:3.8 diff --git a/tempsdb/chunks/base.pyx b/tempsdb/chunks/base.pyx index 0fa4df86a80ed4c0c16083814c1fafc369bf1d0d..5a90cb6b45afcba59ec8ac929ce4611afd819570 100644 --- a/tempsdb/chunks/base.pyx +++ b/tempsdb/chunks/base.pyx @@ -58,11 +58,10 @@ cdef class AlternativeMMap: self.io.seek(item, 0) b = self.io.read(1) return b[0] - else: - start = item.start - stop = item.stop - self.io.seek(start, 0) - return self.io.read(stop-start) + start = item.start + stop = item.stop + self.io.seek(start, 0) + return self.io.read(stop-start) def __setitem__(self, key: tp.Union[int, slice], value: tp.Union[int, bytes]) -> None: cdef: @@ -228,7 +227,7 @@ cdef class Chunk: if index > self.entries: raise ValueError('index too large') cdef unsigned long ofs = HEADER_SIZE + TIMESTAMP_SIZE + index * (self.block_size + TIMESTAMP_SIZE) + byte_index - return ord(self.mmap[ofs]) + return self.mmap[ofs] cpdef bytes get_slice_of_piece_starting_at(self, unsigned int index, unsigned int start): """