https://pantsbuild.org/ logo
#development
Title
# development
w

witty-crayon-22786

10/03/2019, 6:34 PM
@hundreds-breakfast-49010: so, i think that
def rules(self)
on testbase is not doing the thing that our actual registrar does
@hundreds-breakfast-49010: ^
options parsing is based on gathering up all of the "Optionable" things
so you might need to fiddle with TestBase a bit to do that... sorry =(
. @happy-kitchen-89482 is very likely to know how to help there though!
h

hundreds-breakfast-49010

10/03/2019, 6:37 PM
kk
hm this is a bit rabbit-hole-ish
I just need a way to get a string from the test method into the
@console_rule
I thought an option would be an easy way to make that happen but apparently not
is there some other solution I'm missing to this?
w

witty-crayon-22786

10/03/2019, 6:44 PM
Um, maybe capture the rules stdout?
h

hundreds-breakfast-49010

10/03/2019, 6:48 PM
I need the other direction, the test needs to provide a string to the @console_rule
w

witty-crayon-22786

10/03/2019, 7:02 PM
A param?
Whoops. Didn't mean to send to channel
But in an isolated context like this, you could install a RootRule for
str
And pass in a
str
when running the rule
And you could wrap it in a newtype if the
str
gives you trouble
(maybe
ConsoleRuleTestBase
doesn't let you pass other args to be used as params... But that would be easy to add)
h

hundreds-breakfast-49010

10/03/2019, 7:18 PM
@witty-crayon-22786 just spend some time digging into this with benjy
he pointed out that in
ConsoleRuleTestBase
we are creating
full_options
there, which has the correct options scope, but then not passing it to
run_console_rule
so maybe this is the bug
I think it would solve my problem at hand more quickly if I just hacked in the ability to pass an additional newtype'd string Param in the test
but this is maybe a bug in the test code worth solving
w

witty-crayon-22786

10/03/2019, 7:20 PM
Yeah, I think both changes would be great. Up to you
h

hundreds-breakfast-49010

10/03/2019, 7:23 PM
I'm gonna make an issue for this but punt on it for now
unless the newtype thing doesn't work for whatever reason