def setUp(self): # patch timestamp to return a known value timestamp_patcher = mock.patch( 'castle.commands.start_impersonation.generate_timestamp.call') self.mock_timestamp = timestamp_patcher.start() self.mock_timestamp.return_value = mock.sentinel.timestamp self.addCleanup(timestamp_patcher.stop)
def setUp(self): # patch timestamp to return a known value timestamp_patcher = mock.patch( 'castle.commands.authenticate.timestamp') self.mock_timestamp = timestamp_patcher.start() self.mock_timestamp.return_value = mock.sentinel.timestamp self.addCleanup(timestamp_patcher.stop)
def setUp(self): # patch timestamp to return a known value timestamp_patcher = mock.patch( 'castle.payload.prepare.generate_timestamp.call') self.mock_timestamp = timestamp_patcher.start() self.mock_timestamp.return_value = '2018-01-02T03:04:05.678' self.addCleanup(timestamp_patcher.stop)