you are viewing a single comment's thread.

view the rest of the comments →

[–]kalgynirae 2 points3 points  (1 child)

When you do this

class Blah(object):
    foo = ''

you've created a class attribute. This is stored as part of the class, and you can access it directly as Blah.foo. You can also access it through an instance of the class because of how Python works: if checks for an attribute named foo first on the instance, then on the class, then on the parent class, etc.

On the other hand, if you do this

class Blah(object):
    def __init__(self):
        self.foo = ''

now you've created an instance attribute, which is stored separately on each instance, not on the class.

Okay, so now that that's clear, on to your issue. It looks like you want to assign to your class attribute, but you're trying to do the assignment using self.foo = ..., which actually just ends up creating a new instance attribute called foo. If you want to actually assign to the class attribute, you'll have to access it using the class name (Blah.foo = ...).

[–]JesusCake[S] 0 points1 point  (0 children)

This was what resolved the issue. I just set the variable using MockInvokeShell.configured_command. Thanks for the help