def test_should_not_deserialize_when_file_does_not_exist(self, mock_exists, mock_deserialize, mock_serialize, mock_lock, mock_unlock): execution = Execution('command', ['-arg1', '-arg2', '-arg3'], 'stdin') commandstub.record_execution(execution) self.assertEqual(None, mock_deserialize.call_args)
def test_should_append_execution_and_serialize(self, mock_exists, mock_deserialize, mock_serialize, mock_lock, mock_unlock): execution = Execution('command', ['-arg1', '-arg2', '-arg3'], 'stdin') commandstub.record_execution(execution) self.assertEqual( call('shtub/executions', ANY), mock_serialize.call_args) actual_recorded_calls = mock_serialize.call_args[0][1] self.assertEqual(str(execution), str(actual_recorded_calls[0]))