def testGetMajorOSVersion10_10(self): self.mox.StubOutWithMock(gmacpyutil, 'GetOSVersion') gmacpyutil.GetOSVersion().AndReturn('10.10.1') self.mox.ReplayAll() major_os_version = gmacpyutil.GetMajorOSVersion() self.assertEqual(major_os_version, '10.10') self.mox.VerifyAll()
def testGetMajorOSVersionFails(self): self.mox.StubOutWithMock(gmacpyutil, 'GetMajorOSVersion') gmacpyutil.GetMajorOSVersion().AndReturn(False) self.mox.ReplayAll() track = gmacpyutil.GetTrack() self.assertEqual(track, 'stable') self.mox.VerifyAll()
def testGetTrackReturnsUnexpected(self): self.mox.StubOutWithMock(gmacpyutil, 'GetMajorOSVersion') self.mox.StubOutWithMock(gmacpyutil, 'MachineInfoForKey') gmacpyutil.GetMajorOSVersion().AndReturn('10.8') gmacpyutil.MachineInfoForKey('Track').AndReturn('foobar') self.mox.ReplayAll() track = gmacpyutil.GetTrack() self.assertEqual(track, 'stable') self.mox.VerifyAll()
def testGetTrackUnsupportedOS(self): self.mox.StubOutWithMock(gmacpyutil, 'GetMajorOSVersion') self.mox.StubOutWithMock(gmacpyutil, 'MachineInfoForKey') gmacpyutil.GetMajorOSVersion().AndReturn('11.0') gmacpyutil.MachineInfoForKey('Track').AndReturn('stable') self.mox.ReplayAll() track = gmacpyutil.GetTrack() self.assertEqual(track, 'unstable') self.mox.VerifyAll()
def testGetTrackEqualsTesting(self): self.mox.StubOutWithMock(gmacpyutil, 'GetMajorOSVersion') self.mox.StubOutWithMock(gmacpyutil, 'MachineInfoForKey') gmacpyutil.GetMajorOSVersion().AndReturn('10.8') gmacpyutil.MachineInfoForKey('Track').AndReturn('testing') self.mox.ReplayAll() track = gmacpyutil.GetTrack() self.assertEqual(track, 'testing') self.mox.VerifyAll()