rc subsystem is not very testable
I'm trying to do tests on libraries that work with the RC subsystem.
One of the problems I'm facing is that it is difficult to mock it - once bob.extension
is imported, the contents of the RC file is loaded and there seems to be no easy way to affect such a value in a cross-module way.
Ideally, what you'd like to do is something like this:
@mock_bobs_rc('var1', 'override-value1')
def test():
# now, code that uses bob.extension.rc will use the mock value
# notice that the code is not necessarily here, but may be used several layers down
Can you think of an easy solution to this?