Exemplo n.º 1
0
    def test_upload_log(self, _, mock_shutil, mock_os, mock_log, mock_drive):
        GDrive.upload_log(mock_drive)

        self.assertTrue(mock_os.path.join.called)
        self.assertTrue(mock_shutil.copyfile.called)
        self.assertTrue(mock_drive._upload_file.called)
        self.assertTrue(mock_log.debug.called)
        self.assertFalse(mock_log.warning.called)
        self.assertTrue(mock_os.remove.called)
Exemplo n.º 2
0
    def test_upload_log_fails(self, mock_shutil, mock_os, mock_log,
                              mock_drive):
        mock_drive._upload_file.return_value = None
        GDrive.upload_log(mock_drive)

        self.assertTrue(mock_os.path.join.called)
        self.assertTrue(mock_shutil.copyfile.called)
        self.assertTrue(mock_drive._upload_file.called)
        self.assertFalse(mock_log.debug.called)
        self.assertTrue(mock_log.warning.called)
        self.assertTrue(mock_os.remove.called)