From d91890a2d26f2bcc8f42f2502f76e8a4a96e6455 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 12 Feb 2012 13:55:42 +0100 Subject: [PATCH] Comeback of GithubObject --- github/GithubObject.UnitTest.py | 22 +++++++++++++++++++++- github/GithubObject.py | 10 +++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/github/GithubObject.UnitTest.py b/github/GithubObject.UnitTest.py index c0ea95bd..0f9e83c7 100644 --- a/github/GithubObject.UnitTest.py +++ b/github/GithubObject.UnitTest.py @@ -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() diff --git a/github/GithubObject.py b/github/GithubObject.py index b28b9a6b..629518fb 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -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