Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Update #17

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Changelog
=========

2.2.3 (2018-01-18)
------------------
* Update dependencies; dependencies are now also pinned in setup.py
* Correct the key size in exception messages
* Fix for construct 2.8.22 and higher
* Fix for hypothesis 3.44.16

2.2.2 (2017-07-06)
-----------------------------------------
* Fix bug when writing MAR files: the index size was incorrect
Expand Down
6 changes: 1 addition & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Overview
* - docs
- |docs|
* - tests
- | |travis| |appveyor| |requires|
- | |travis| |requires|
| |coveralls| |codecov|
* - package
- |version| |downloads| |wheel| |supported-versions| |supported-implementations|
Expand All @@ -23,10 +23,6 @@ Overview
:alt: Travis-CI Build Status
:target: https://travis-ci.org/mozilla/build-mar

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/mozilla/build-mar?branch=master&svg=true
:alt: AppVeyor Build Status
:target: https://ci.appveyor.com/project/mozilla/build-mar

.. |requires| image:: https://requires.io/github/mozilla/build-mar/requirements.svg?branch=master
:alt: Requirements Status
:target: https://requires.io/github/mozilla/build-mar/requirements/?branch=master
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx>=1.3
sphinx-rtd-theme
requests[security]
sphinx-rtd-theme==0.2.4
requests[security]==2.18.4
-e .
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#
# pip-compile --output-file requirements.txt requirements.in
#
asn1crypto==0.23.0 # via cryptography
backports.lzma==0.0.8 ; python_version < "3.3"
cffi==1.11.2 # via cryptography
asn1crypto==0.24.0 # via cryptography
backports.lzma==0.0.10 ; python_version < "3.3"
cffi==1.11.4 # via cryptography
click==6.7
construct==2.8.16
cryptography==2.1.2
construct==2.9.27
cryptography==2.1.4
enum34==1.1.6 # via cryptography
idna==2.6 # via cryptography
ipaddress==1.0.18 # via cryptography
ipaddress==1.0.19 # via cryptography
pycparser==2.18 # via cffi
six==1.11.0 # via cryptography
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def read(*names, **kwargs):

setup(
name='mar',
version='2.2.2',
version='2.2.3',
license='MPL 2.0',
description='Package for handling Mozilla Archive files.',
long_description='%s\n%s' % (
Expand Down
4 changes: 2 additions & 2 deletions src/mardor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

The primary modules of interest are `mardor.reader` and `mardor.writer`
"""
version = (2, 2, 2)
version_str = "2.2.2"
version = (2, 2, 3)
version_str = "2.2.3"
2 changes: 1 addition & 1 deletion src/mardor/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
productinfo_entry = "productinto_entry" / Struct(
# TODO: Can we make this a Rebuild as well as have Padding calculated?
"size" / Int32ub,
"id" / Const(Int32ub, 1),
"id" / Const(value=1, subcon=Int32ub),
"channel" / CString(encoding='ascii'),
"productversion" / CString(encoding='ascii'),
"padding" / Padding(this.size - len_(this.channel) -
Expand Down
26 changes: 14 additions & 12 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
#
# pip-compile --output-file test-requirements.txt test-requirements.in
#
asn1crypto==0.23.0
backports.lzma==0.0.8 ; python_version < "3.3"
cffi==1.11.2
asn1crypto==0.24.0
attrs==17.4.0 # via hypothesis, pytest
backports.lzma==0.0.10 ; python_version < "3.3"
cffi==1.11.4
click==6.7
construct==2.8.16
coverage==4.4.1 # via pytest-cov
cryptography==2.1.2
construct==2.9.27
coverage==4.5 # via hypothesis, pytest-cov
cryptography==2.1.4
enum34==1.1.6
funcsigs==1.0.2 # via mock
hypothesis==3.33.0
funcsigs==1.0.2 # via mock, pytest
hypothesis==3.44.26
idna==2.6
ipaddress==1.0.18
ipaddress==1.0.19
mock==2.0.0
pbr==3.1.1 # via mock
py==1.4.34 # via pytest
pluggy==0.6.0 # via pytest
py==1.5.2 # via pytest
pycparser==2.18
pytest-cov==2.5.1
pytest-travis-fold==1.2.0
pytest==3.2.3
pytest-travis-fold==1.3.0
pytest==3.4.0
six==1.11.0
19 changes: 9 additions & 10 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@
from mardor.utils import takeexactly


@given(st.lists(st.binary()), st.integers(min_value=0))
def test_takeexactly(data, n):
assume(len(b''.join(data)) >= n)
@given(st.lists(st.binary()))
def test_takeexactly(data):
n = len(b''.join(data))
for i in range(n+1):
assert len(b''.join(takeexactly(data, i))) == i

assert len(b''.join(takeexactly(data, n))) == n


@given(st.lists(st.binary()), st.integers(min_value=0))
def test_takeexactly_notenough(data, n):
assume(len(b''.join(data)) < n)

@given(st.lists(st.binary()))
def test_takeexactly_notenough(data):
n = len(b''.join(data))
with pytest.raises(ValueError):
b''.join(takeexactly(data, n))
b''.join(takeexactly(data, n+1))


@given(st.lists(st.binary()), st.integers(min_value=1, max_value=9))
Expand Down