36 Commits

Author SHA1 Message Date
prculley
8366ceb896 Allow filters/rules via plugin without fail on restart 2019-05-13 19:30:03 +01:00
Nick Hall
3096c2b09a Remove extraneous whitespace after assignment 2019-05-12 11:41:11 +01:00
Nick Hall
14faa46363 Use with-block when writing to file 2017-05-11 17:25:14 +01:00
Nick Hall
1b18b652bb Remove TestLogger and associated unit test
This is not used anywhere. In current python versions, basicConfig
is called automatically when there is no root handler. It is easy
to add a FileHandler if required.
2017-05-11 17:18:17 +01:00
Nick Hall
0d704f03d8 Ignore log messages during unit test capture 2017-05-11 15:03:42 +01:00
Nick Hall
8086d9f2ca Revert "Increase logging level during unit tests"
This reverts commit 709f3a33d5704d04490316efbe9ea5f1719bea7c.
2017-05-11 01:05:42 +01:00
Nick Hall
709f3a33d5 Increase logging level during unit tests 2017-05-10 23:53:54 +01:00
Nick Hall
5ffb4bcfac Add missing __init__.py in test directories 2017-05-08 21:43:33 +01:00
Nick Hall
3b9d97d348 Suppress extraneous output in unit tests 2017-03-06 21:55:48 +00:00
Nick Hall
d0b50caea1 Change "GRAMPS" to "Gramps" in comments and docstrings 2017-02-20 19:05:48 +00:00
prculley
42f2ac04e9 Fix test utility; more console output and make user directories
Console output sows even if an exception occurs
Make user directories if not present
2017-01-25 13:57:53 -06:00
Paul Culley
e584704e7b Update Merge tests to actually run
So this was a lot of work...

Updated to use lxml, steep learning curve for someone who never examined XML before...

The merge test code needed some updates because it was last used with an older version of the Gramps XML.

Found another bug in the mergefamilyquery code when test started running; another nonetype issue.

Found another bug in the mergepersonquery code when test started running; another nonetype issue.

Couldn't get the subprocess stuff to work right, so changed code to just call Gramps with capture, similar to export_tests. This in turn required that importxml and exportxml be slightly changed to support StringIO redirection of stdin and stdout.

And test_util needed a change to allow stdout to accept an unencoded stream, so I added an option to use BytesIO for this test as well.

Added some code to save input, result, and expected data to files in Gramps temp directory for debugging whenever an error occurred. Easier to use my editor in diff mode than look at the outputs.
2016-12-06 11:17:54 +11:00
prculley
ce756cedf2 Add tests 2016-09-24 09:58:37 -05:00
kulath
6e8df15dcb 2092: Problems when no database is open. Partial fix. Make checks on the
database consistently check that the database exists and is open. Add a
few missing checks. Remove redundant load and direct close of dummy
database on closure.
2016-07-05 11:19:02 +01:00
Nick Hall
e76a27ddd3 Remove trailing whitespace 2016-05-10 16:52:57 +01:00
Nick Hall
f688a96e9a Tidy up class definitions
All python3 classes are new-style classes.  It is no longer
necessary to inherit from object.
2016-05-10 16:06:49 +01:00
Doug Blank
ad3dcb8d13 Hide db._select(); Refactor db._tables; QuerySet; tests and bug fixes
db.select() has become db._select()

This commit refactors database._tables so that they can work properly
after a proxy or filter has been removed.

It adds abstract API called QuerySet which allows a variety of
selections and ordering of data.

Logging was added to sqlite to better see db access.

Additional fixes:

* clearing GenericDB._directory
* test_util_test off-by-one error
2016-02-28 15:40:16 -05:00
Doug Blank
7b0b23c6f1 Added database testing; fixed bugs in select
* WIP: Tests BSDDB and DBAPI databases
* testing select and get_field
* fixed a bug in primaryobj
2016-01-28 06:44:41 -05:00
Doug Blank
195fdc3cf8 Removed should_exit from tests 2016-01-05 13:17:11 -05:00
Doug Blank
01ef775491 Use CLI test framework; fix bug in fake exit
* uses new Gramps() test framework in cli_test.py
* test_util.Gramps allows default exit code
2015-12-18 08:46:35 -05:00
Doug Blank
d5aa7067ea Add framework for testing CLI commands
* can grab output, stderr for testing output
* can redirect input, via function
* doesn't test --show, but all other CLI flags
2015-12-18 07:32:44 -05:00
Nick Hall
cdee00aca2 Remove trailing whitespace 2015-08-23 18:42:07 +01:00
Doug Blank
ad1d47cc37 Fix and enable test_util_test 2015-03-18 03:25:39 -04:00
Nick Hall
3b5efdf7ae Remove imports from __future__ module 2015-03-14 16:10:36 +00:00
Doug Blank
ed70aa0d74 Fix date_handler by renaming non-test methods; removed gedcom import tests that rely on old code, and didn't test much 2015-01-03 09:15:58 -05:00
Malcom Lewis
86303f6116 Update FSF address to current location. 2014-08-08 19:39:45 -07:00
Nick Hall
f6be31eb39 Remove subversion substitution variables 2014-04-15 14:10:18 +01:00
John Ralls
85a1c39092 7258: Transcode FS paths to avoid a crash
The problem is really that the paths get munged into strings in the
system codepage, losing or misinterpreting most Unicode. Python's os
module is smart enough to encode the unicode to the file system
encoding, but the bsddb module needs a little help.

Provide a new function, constfunc.get_env_var(name, default=None) to
cleanly import Unicode environment variables in Windows and use it in
place of all instances of foo = os.environ['BAR] or foo =
os.environ.get('BAR').

Os path functions are smart enough to convert unicode to the file system
encoding on their own, but Db functions aren't, so provide an _encode
function in gen.db.write.py and apply it where a path is being passed to
DBEnv.open().

Also convert paths from the UI to unicode from 'utf8' rather than
sysfilesystemencoding. The latter happens to be correct most of the time
on Linux and OSX but is wrong on Windows.
2014-03-23 15:09:51 -07:00
Nick Hall
9050f96dad Skip .git instead of .svn directories 2013-11-09 00:10:46 +00:00
Nick Hall
b3ddf9f83a Fix and move keyword unit test
svn: r22759
2013-07-28 18:11:35 +00:00
Nick Hall
772cf39d7f Fix and move config unit test
svn: r22757
2013-07-28 17:36:35 +00:00
Nick Hall
696ee7aad0 Fix and move CLI unit test
svn: r22755
2013-07-28 16:20:30 +00:00
Paul Franklin
dc128110bc typos
svn: r22021
2013-04-19 16:58:24 +00:00
Benny Malengier
bb5fc7cb7c 2620: GEPS 031: Python 3 support - 3.2
This does patch updates Gramps to the 3.2 syntax, it does not yet mean Gramps works with python 3.2
Expect next day commits to fix further issues, but this is the main 2to3 tool created patch changed
where needed to have python 2.7 work. 
Specific issues might be:
  1. next has been changed, must be checked
  2. new division as on the wiki page listed is to do
  3. ...


svn: r20634
2012-11-07 17:53:14 +00:00
Nick Hall
55c19e4180 Changes to imports - part 7
svn: r20492
2012-10-02 21:08:19 +00:00
Benny Malengier
326d604365 GEPS 026: Replace 'make' for Gramps build
If we want to use Gramps from the code directory, src should be called gramps to allow import


svn: r20466
2012-09-30 11:55:52 +00:00