Пример #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())