Comeback of GithubObject

This commit is contained in:
Vincent Jacques
2012-02-12 13:55:42 +01:00
parent a1ce5a0dbd
commit d91890a2d2
2 changed files with 30 additions and 2 deletions
+21 -1
View File
@@ -1,5 +1,25 @@
import unittest
import MockMockMock
from GithubObject import GithubObject
from GithubObject import GithubObject, SimpleScalarAttributes
class TestCase( unittest.TestCase ):
def setUp( self ):
unittest.TestCase.setUp( self )
self.g = MockMockMock.Mock( "github" )
self.o = self.GithubTestObject( self.g.object, { "a1": 1, "a2": 2 }, lazy = True )
def tearDown( self ):
self.g.tearDown()
unittest.TestCase.tearDown( self )
class GithubObjectWithOnlySimpleAttributes( TestCase ):
GithubTestObject = GithubObject(
"GithubTestObject",
SimpleScalarAttributes( "a1", "a2", "a3", "a4" )
)
def testConstruction( self ):
pass # Everything is done in setUp/tearDown
unittest.main()
+9 -1
View File
@@ -1,2 +1,10 @@
class SimpleScalarAttributes:
def __init__( self, *attributes ):
self.__attributes = attributes
def GithubObject( *attributes ):
pass
class GithubObject:
def __init__( self, github, attributes, lazy ):
pass
return GithubObject