[crossfire] Using Mock Object patch autospec with plugins/cfpython?

Bob Tanner tanner at real-time.com
Sun Dec 29 12:40:54 CST 2019


Been validating the maps/python code for python3 compliancy and started to do some unit testing and ran into a problem.

I surmise the Crossfire object I need to import, comes from server/plugins/cfpython directory?

Though I do not find how this code “works” and gives me a python package to import.

I see several of the maps/python scripts import this package, example maps/python/casion/diamondslots.py

import Crossfire
import CFGamble
import CFItemBroker
<snip>

Normally, I’d create a Mock Object for the Crossfire package something like this:

@patch(‘Crossfire', autospec=True)
def test_WhoAmI(self, mock_Crossfire):
    pass

I’ve never tried to autospec a package that is created from C code.

Am I way off base here?

Is there a “traditional” Crossfire package somewhere and I’m just missing it?
 

—
Bob Tanner <tanner at real-time.com>  | Phone : (952)943-8700
https://keybase.io/basictheprogram     | http://www.real-time.com
Key fingerprint = F785 DDFC CF94 7CE8 AA87 3A9D 3895 26F1 0DDB E378



More information about the crossfire mailing list