Exemplo n.º 1
0
    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()
Exemplo n.º 2
0
    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()
Exemplo n.º 3
0
    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()
Exemplo n.º 4
0
    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()
Exemplo n.º 5
0
    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()