def testGetWithWorkingHours(self):
    self.mox.StubOutWithMock(applesus, 'settings')
    applesus.settings.HOUR_START = 9
    applesus.settings.HOUR_STOP = 15

    now = datetime.datetime(  # Dec 10, 2014 20:00:00
        2014, 12, 10, 20, 00, 00, 000000)
    today = now.date()

    mock_product_promote_testing = self.mox.CreateMockAnything()
    mock_product_promote_testing.tracks = ['unstable']
    mock_product_promote_testing.product_id = 'fooid1'
    mock_product_promote_testing.manual_override = False
    mock_product_promote_testing.mtime = 'testingpromotetime'

    mock_product_promote_stable = self.mox.CreateMockAnything()
    mock_product_promote_stable.tracks = ['unstable', applesus.common.TESTING]
    mock_product_promote_stable.product_id = 'fooid3'
    mock_product_promote_stable.manual_override = False
    mock_product_promote_stable.mtime = 'stablepromotetime'

    testing_products = [mock_product_promote_testing]
    stable_products = [mock_product_promote_stable]

    self.mox.StubOutWithMock(applesus.models.AppleSUSProduct, 'all')
    self.mox.StubOutWithMock(applesus.applesus, 'GenerateAppleSUSCatalogs')
    self.mox.StubOutWithMock(applesus.models.AdminAppleSUSProductLog, 'Log')
    self.mox.StubOutWithMock(applesus.applesus, 'GetAutoPromoteDate')

    promotions = {}
    mock_query = self.mox.CreateMockAnything()

    # testing promote
    applesus.models.AppleSUSProduct.all().AndReturn(mock_query)
    mock_query.filter('tracks !=', applesus.common.TESTING).AndReturn(
        testing_products)
    applesus.applesus.GetAutoPromoteDate(
        applesus.common.TESTING, mock_product_promote_testing).AndReturn(today)
    promotions[applesus.common.TESTING] = []

    # stable promote
    applesus.models.AppleSUSProduct.all().AndReturn(mock_query)
    mock_query.filter('tracks !=', applesus.common.STABLE).AndReturn(
        stable_products)
    applesus.applesus.GetAutoPromoteDate(
        applesus.common.STABLE, mock_product_promote_stable).AndReturn(today)
    promotions[applesus.common.STABLE] = []

    self.mox.ReplayAll()
    self.c.get(now=now)

    self.assertTrue(
        applesus.common.TESTING not in mock_product_promote_testing.tracks)
    self.assertTrue(
        applesus.common.STABLE not in mock_product_promote_stable.tracks)

    self.mox.VerifyAll()
Tests get() outside of working hours.
dataset/ETHPy150Open google/simian/src/tests/simian/mac/cron/applesus_test.py/AppleSUSAutoPromoteTest.testGetWithWorkingHours