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