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

kMDItemAuthors tests fail on Big Sur, Monterey but not on Catalina #68

Open
RhetTbull opened this issue Oct 9, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@RhetTbull
Copy link
Owner

    I'll add a note to the docs about temporary files.  I got the test suite running last night in GitHub actions (via a BigSur VM, the latest available in GitHub).  Interestingly the same three tests fail with the same result.  Something about `kMDItemAuthors` isn't right for macOS > Catalina.   I'll open a separate issue for this. 
tests/test_cli.py:517: AssertionError
=========================== short test summary info ============================
FAILED tests/test_cli.py::test_cli_remove - AssertionError: assert ['John Doe...
FAILED tests/test_cli.py::test_cli_backup_restore - AssertionError: assert no...
FAILED tests/test_cli.py::test_cli_order - AssertionError: assert ['John Doe'...
=================== 3 failed, 551 passed, 3 skipped in 8.14s ===================

Originally posted by @RhetTbull in #61 (comment)

@RhetTbull RhetTbull added the bug Something isn't working label Oct 9, 2022
@RhetTbull
Copy link
Owner Author

RhetTbull commented Oct 14, 2022

I am able to replicate this on a machine with Big Sur. The CLI tests manipulating kMDItemAuthors fail every time BUT when I open a python REPL and shell and replicate the tests manually, line by line, everything works as expected. I believe this and the finder comment failures have something to do with the pytest environment but I can't figure out the issue.

>>> from osxmetadata import *
>>> md = OSXMetaData("test_file.txt")
>>> md.tags = [Tag("test",0)]
>>> md.tags
[Tag(name='test', color=0)]
>>> md.authors = ["John Doe", "Jane Doe"]
>>> md.wherefroms =["http://www.apple.com"]
>>> import datetime
>>> md.downloadeddate = [datetime.datetime(2019,1,1)]
>>> md.findercomment = "Hello World"
python -m osxmetadata test_file.txt --get comment --set authors "John
 Smith" --restore --set title "Test Title" --clear title --append tags test2 --set comment foo --remove authors "Jane Do
e" --append authors "Jane Smith" --mirror comment findercomment
comment                   kMDItemComment                    = Hello World
Python 3.10.4 (main, Apr 26 2022, 19:43:24) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from osxmetadata import *
>>> from osxmetadata import *
>>> md = OSXMetaData("test_file.txt")
>>> md.authors
['John Smith', 'Jane Smith']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant