示例#1
0
 def testGetAttrBad(self):
    i = ImageI()
    def assign_loaded():
         i.loaded = False
    self.assertRaises( AttributeError, assign_loaded )
    self.assertRaises( AttributeError, lambda: i.foo )
    def assign_foo():
         i.foo = 1
    self.assertRaises( AttributeError, assign_foo )
    self.assertRaises( AttributeError, lambda: i.annotationLinks )
    self.assertRaises( AttributeError, lambda: i.getAnnotationLinks() )
    def assign_links():
         i.annotationLinks = []
    self.assertRaises( AttributeError, assign_links)
示例#2
0
 def testGetAttrBad(self):
    i = ImageI()
    def assign_loaded():
         i.loaded = False
    pytest.raises( AttributeError, assign_loaded )
    pytest.raises( AttributeError, lambda: i.foo )
    def assign_foo():
         i.foo = 1
    pytest.raises( AttributeError, assign_foo )
    pytest.raises( AttributeError, lambda: i.annotationLinks )
    pytest.raises( AttributeError, lambda: i.getAnnotationLinks() )
    def assign_links():
         i.annotationLinks = []
    pytest.raises( AttributeError, assign_links)
示例#3
0
    def testGetAttrBad(self):
        i = ImageI()

        def assign_loaded():
            i.loaded = False
        pytest.raises(AttributeError, assign_loaded)
        pytest.raises(AttributeError, lambda: i.foo)

        def assign_foo():
            i.foo = 1
        pytest.raises(AttributeError, assign_foo)
        pytest.raises(AttributeError, lambda: i.annotationLinks)
        pytest.raises(AttributeError, lambda: i.getAnnotationLinks())

        def assign_links():
            i.annotationLinks = []
        pytest.raises(AttributeError, assign_links)