Commit graph

26 commits

Author SHA1 Message Date
TheJackiMonster 98d6eb4975
Remove usage of hardcoded path separators
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2023-12-12 15:53:37 +01:00
Tobias Frisch 692995f51c
Merge pull request #831 from zeth/loadsave_test
Write a test for ParseMMDFile function.
2022-06-08 13:24:47 +02:00
Belug d22eb3bcb9 Fixing the tests for travis-CI 2021-04-09 19:19:03 -04:00
Jan Wester 8884bac0ed Added logging & proper argument parsing.
Sometimes you want to do just one thing, and in the process of
implementing that one thing, you implement several others. This is one
of those types of commits.

Implementing the argparse library is for the sake of controlling the
logging behaviour as well as other future I have yet to implement.

It has all the standard goodies you'd expect, and I have also ported
over the existing commandline arguments. (They may need a bit of polish
still, but there is no regression compared to before, only improvement.)

The logger is because it really needed to happen for numerous reasons.

It still logs to the terminal, but by default it only does so for
messages classified WARNING and above. These are the things we actively
want users to see. But if this is not good enough, adding the --verbose
flag will increasingly show more (-v shows INFO level and -vv also shows
the DEBUG messages) so that us coders don't have to miss anything in the
most convenient location.

It also logs to a file with the very original filename manuskript.log. I
may have to add commandline and/or settings arguments to improve that at
some point in the future, but there distractions are endless.

The log file contains timestamps and module information for easy
interpretation that are not present on the terminal, and it contains all
messages classified DEBUG and up. Ideally users will just be able to
attach it to an issue(*) to deliver us all the information we need to
help them with their inquiry.

Last but not least, the other reason I needed logging implemented is
that Qt has its own logging framework, and I needed to figure out how to
siphon out the data and make it shut up. But there was no point in doing
that as long as our own logging facilities were lacking...

(*) I have yet to convert all existing print statements over to the new
system, but that is probably going to be the next commit. This one has
enough change in it already.
2021-04-08 18:29:15 +02:00
Moisés J 1e52af54e2 Add global search 2021-04-02 14:15:17 +01:00
TheJackiMonster 12be4c3a3d
Fixed all Python syntax warnings 2021-02-21 23:45:34 +01:00
Zeth Green 344c21be5f Add a test to prove a scene's content comes through. 2021-02-02 23:29:17 +00:00
Zeth Green 0bbf70b455 Make the naming match here too. 2021-02-02 21:59:02 +00:00
Zeth Green 2410598de0 More consistant naming. 2021-02-02 21:54:39 +00:00
Zeth Green 64c67eaf48 Write a test for ParseMMDFile function. 2021-02-02 21:47:36 +00:00
Curtis Gedak be35786b68 Default keep revisions to disabled, and remove tests for revisions
This commit sets the "keep revisions" setting to disabled by default
for new projects.  It also removes the test cases associated with
revisions.

The revisions feature as currently implemented is of questionable use.
It has been a source of performance issues for users, and has consumed
developer time in attempts to address its shortcomings.  This commit
is the first step to deprecate the current revisions feature.
2019-09-22 10:45:07 -06:00
luz.paz 2fd45dc42c Fix misc. typos
Found via `codespell -q 3 -S *.ts,./libs,./sample-projects -L searchin`
2019-09-19 09:58:24 -06:00
Curtis Gedak af53102e77 Fix pytest warning about duplicate name when running tests
When running pytest on kubuntu 16.04 the following warning was displayed:

    $ python3 -m pytest -v
    ...
    ./manuskript/load_save/version_1.py:319: \
    UserWarning: Duplicate name: 'outline/0-Folder/0-Text-3.md'
      zf.writestr(filename, content, compress_type=compression)

The error was tracked down using the following pytest invocation:

    $ python3 -m pytest -v -W error::UserWarning

This invocation showed 4 occurrences similar to the following warning:

    self = <zipfile.ZipFile filename='/tmp/tmpgs_sjpzr.msk' mode='w'>
    zinfo = <[AttributeError("compress_size") raised in repr()] \
    ZipInfo object at 0x7f3cc0124588>

        def _writecheck(self, zinfo):
            """Check for errors before writing a file to the archive."""
            if zinfo.filename in self.NameToInfo:
                import warnings
    >           warnings.warn('Duplicate name: %r' % zinfo.filename, \
                stacklevel=3)
    E           UserWarning: Duplicate name: 'outline/0-Folder/0-Text-3.md'

These warnings arose in the following 4 tests:

  - test_references
  - test_autoLoad
  - test_loadExportWiget
  - test_loadImportWiget

The cause of the issue is that in manuskript/tests/conftest.py, the
mainWindow::closeProject() method is called to close the project, but
the project was never loaded.  This meant the zip file setting
defaulted to True, when in fact the Acts sample project is not stored
in a single zip project file.

Fix by removing the call to MW.closeProject() before the project is
loaded.
2018-11-16 12:52:09 -07:00
Olivier Keshavjee 43c82cb3c9 Adds: simple ui tests for exporter and importer widgets 2017-11-22 11:27:21 +01:00
Olivier Keshavjee f945387066 Adds unit test for #225: Manuskript fails to run in Ubuntu 14.04 2017-11-22 09:08:54 +01:00
Olivier Keshavjee 8ff046b23b Extends coverage in settingsWindow 2017-11-20 23:26:22 +01:00
Olivier Keshavjee a7f668c2bf Fixes test_settingsWindow and clean up 2017-11-20 22:35:39 +01:00
Olivier Keshavjee b9e35c8709 Adds unit tests for settingWindow 2017-11-20 22:24:47 +01:00
Olivier Keshavjee 9d3b64de8f Adds: references tests, corrects bugs 2017-11-20 15:42:30 +01:00
Olivier Keshavjee 7db2848474 This should build with SemaphoreCI 2017-11-19 17:54:04 +01:00
Olivier Keshavjee f098e74f45 Adds: unit test coverage for outlineItem 2017-11-19 16:03:18 +01:00
Olivier Keshavjee 584b0b04a6 Checkpoint: revisions 2017-11-19 15:29:38 +01:00
Olivier Keshavjee a0fac27e07 Checkpoint: outlineItem tests 2017-11-19 01:36:58 +01:00
Olivier Keshavjee 159e1c3f75 Adds mainWindow and completes function.py coverage 2017-11-19 00:54:11 +01:00
Olivier Keshavjee 1a5fdc7b1f Adds unit tests for functions 2017-11-19 00:20:49 +01:00
Olivier Keshavjee 84466b90e3 Adding unit test 2017-11-18 22:07:10 +01:00