Closed ekkis closed 1 year ago
Huh. That's kinda curious ...
My results:
(venv310) d@Davids-Laptop > env PYTHONPATH=. python test/test_message.py
........................................./Users/d/w/simplefix-2/simplefix/message.py:147: DeprecationWarning: simplefix.FixMessage.append_time() is deprecated. Use append_utc_timestamp() or append_tz_timestamp() instead.
warnings.warn("simplefix.FixMessage.append_time() is deprecated. "
....................................................
----------------------------------------------------------------------
Ran 93 tests in 0.005s
OK
(venv310) d@Davids-Laptop >
The deprecation warnings are expected, and fine, but it looks like your FixMessage
doesn't have the to_string()
method, which is pretty odd.
I have no idea how this could be happening. If possible, could you check a couple of things?
import simplefix
. Then print(simplefix.__file__)
and confirm that it's importing from the disk location you expect? For me that's>>> import simplefix >>> print(simplefix.__file__) /Users/d/w/simplefix-2/simplefix/__init__.py >>> ```
simplefix/message.py
code, around line 585, to ensure it actually has the to_string
method in the source code?Thanks for the report, I'm very keen to figure this one out!
I see: /usr/local/lib/python3.9/site-packages/simplefix/__init__.py
. in the message.py I see:
582 def __str__(self):
583 """Return string form of message contents."""
584 s = ""
585 for tag, value in self.pairs:
586 if s:
587 s += "|"
588 s += tag.decode("ascii") + "=" + value.decode("ascii")
589 return s
Thank you for that. I think I understand what's going on now.
The test_message.py
file that you've copied is from the master branch, but I think you're running it against the v1.0.15 installed package. The to_string
method was added after v1.0.15 was released.
See this commit https://github.com/da4089/simplefix/commit/1de83d2d61a265364b54bf35f446ec352995682b
You could download the v1.0.15 version of test_message.py
from https://github.com/da4089/simplefix/blob/v1.0.15/test/test_message.py, and it should run with just the deprecation warnings.
that makes perfect sense. I installed using pip so I got whatever version is available from the repo but to test I cloned. thank you very much
I grabbed simplefix/test/test_message.py and tried to run it but it fails the following test:
what does it need?