Skip to content

test_lockfile_from_pipfile_meta and test_hash_from_hash due to string case #8

Description

@jayvdb

I'm packaging this for openSUSE, and ran into these two errors only on openSUSE Leap 42.3 's Python 2.7, which is 2.7.13 .. it looks like it might even be that the Python hashlib is giving uppercase.

[   40s] _______________________ test_lockfile_from_pipfile_meta ________________________
[   40s] 
[   40s]     def test_lockfile_from_pipfile_meta():
[   40s]         pipfile = Pipfile({
[   40s]             "source": [
[   40s]                 {
[   40s]                     "name": "pypi",
[   40s]                     "url": "https://pypi.org/simple",
[   40s]                     "verify_ssl": True,
[   40s]                 },
[   40s]             ],
[   40s]             "requires": {
[   40s]                 "python_version": "3.7",
[   40s]             }
[   40s]         })
[   40s]         pipfile_hash_value = pipfile.get_hash().value
[   40s]         lockfile = Lockfile.with_meta_from(pipfile)
[   40s]     
[   40s]         pipfile.requires._data["python_version"] = "3.8"
[   40s]         pipfile.sources.append({
[   40s]             "name": "devpi",
[   40s]             "url": "http://localhost/simple",
[   40s]             "verify_ssl": True,
[   40s]         })
[   40s]     
[   40s] >       assert lockfile.meta.hash._data == {"sha256": pipfile_hash_value}
[   40s] E       AssertionError: assert {'SHA256': '7...baa518a65489'} == {'sha256': '7e...baa518a65489'}
[   40s] E         Left contains more items:
[   40s] E         {u'SHA256': '7e7ef69da7248742e869378f8421880cf8f0017f96d94d086813baa518a65489'}
[   40s] E         Right contains more items:
[   40s] E         {u'sha256': '7e7ef69da7248742e869378f8421880cf8f0017f96d94d086813baa518a65489'}
[   40s] E         Use -v to get the full diff
[   40s] 
[   40s] tests/test_lockfiles.py:114: AssertionError
[   40s] _____________________________ test_hash_from_hash ______________________________
[   40s] 
[   40s]     def test_hash_from_hash():
[   40s]         v = hashlib.md5(b"foo")
[   40s]         h = models.Hash.from_hash(v)
[   40s] >       assert h.name == "md5"
[   40s] E       AssertionError: assert 'MD5' == 'md5'
[   40s] E         - MD5
[   40s] E         + md5
[   40s] 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions