def testCreateGetMethod(self):

    mock_dataobj = self.mox.CreateMockAnything()
    mock_dataobj._GetDataDict().AndReturn({'foo': 123})

    def mock_setattr(cls, key, value):
      self.assertEquals(key, 'GetFoo')
      self.assertTrue(type(value) is types.FunctionType)
      self.assertEqual(123, value(mock_dataobj))

    self.mox.ReplayAll()
    x509.BaseDataObject.CreateGetMethod('Foo', 'foo', setattr_=mock_setattr)
    self.mox.VerifyAll()
Sets up the needed objects used throughout the test.
dataset/ETHPy150Open google/simian/src/tests/simian/auth/x509_test.py/BaseDataObjectTest.testCreateGetMethod--crossover with--dataset/ETHPy150Open log2timeline/dfvfs/tests/vfs/tsk_partition_file_entry.py/TSKPartitionFileEntryTest.setUp