示例#1
0
    def test_has_attr_fail_wrong_value(self):
        class Config(object):
            color = 'red'

        widget = Fake("widget").expects("configure")\
                               .with_args(arg.has_attr(color="green"))
        widget.configure(Config())
示例#2
0
    def test_has_attr_fail(self):
        class Config(object):
            color = 'red'

        widget = Fake("widget").expects("configure")\
                               .with_args(arg.has_attr(size=12))
        widget.configure(Config())
示例#3
0
    def test_has_attr_fail_wrong_value(self):
        class Config(object):
            color = 'red'

        widget = Fake("widget").expects("configure")\
                               .with_args(arg.has_attr(color="green"))
        widget.configure(Config())
示例#4
0
    def test_has_attr_fail(self):
        class Config(object):
            color = 'red'

        widget = Fake("widget").expects("configure")\
                               .with_args(arg.has_attr(size=12))
        widget.configure(Config())
示例#5
0
    def test_has_attr_ok(self):
        class Config(object):
            size = 12
            color = 'red'
            weight = 'heavy'

        widget = Fake("widget").expects("configure")\
                               .with_args(arg.has_attr(size=12,color='red'))
        widget.configure(Config())
示例#6
0
    def test_has_attr_ok(self):
        class Config(object):
            size = 12
            color = 'red'
            weight = 'heavy'

        widget = Fake("widget").expects("configure")\
                               .with_args(arg.has_attr(size=12,color='red'))
        widget.configure(Config())