Improve coverage, fix bugs

This commit is contained in:
Vincent Jacques
2012-02-18 18:22:05 +01:00
parent cbbe08a59e
commit 6f73ad23c4
4 changed files with 97 additions and 12 deletions
+39
View File
@@ -298,4 +298,43 @@ class GithubObjectWithMethodFromCallable( TestCaseWithGithubTestObject ):
self.assertEqual( self.o.myMethod( mock.object, 42 ), 72 )
mock.tearDown()
class GithubObjectWithSeveralBasicAttributesAndComplexAttributes( TestCaseWithGithubTestObject ):
ContainedObject = GithubObject(
"ContainedObject",
BaseUrl( lambda obj: "/test/a3s/" + obj.id ),
BasicAttributes( "id", "name" )
)
GithubTestObject = GithubObject(
"GithubTestObject",
BaseUrl( lambda obj: "/test" ),
BasicAttributes( "a2", "a4" ),
BasicAttributes( "a1", "a3" ),
ComplexAttribute( "a5", ContainedObject ),
)
def testCompletionInOneCall_1( self ):
self.expectDataGet( "/test" ).andReturn( {} )
self.assertIsNone( self.o.a3 )
self.assertIsNone( self.o.a4 )
self.assertIsNone( self.o.a5 )
def testCompletionInOneCall_2( self ):
self.expectDataGet( "/test" ).andReturn( {} )
self.assertIsNone( self.o.a4 )
self.assertIsNone( self.o.a3 )
self.assertIsNone( self.o.a5 )
def testCompletionInOneCall_3( self ):
self.expectDataGet( "/test" ).andReturn( {} )
self.assertIsNone( self.o.a5 )
self.assertIsNone( self.o.a3 )
self.assertIsNone( self.o.a4 )
def testCompletionInOneCall_4( self ):
self.expectDataGet( "/test" ).andReturn( {} )
self.assertIsNone( self.o.a5 )
self.assertIsNone( self.o.a4 )
self.assertIsNone( self.o.a3 )
unittest.main()