Commit Graph

340 Commits

Author SHA1 Message Date
517b237636 tests: fix test databases 2020-08-18 10:23:56 -04:00
7538c6201b tests: new fsck tests for interval overlap 2020-08-18 10:18:54 -04:00
7056c5b4ec tests: new fsck tests 2020-08-18 10:03:34 -04:00
d4003d0d34 tests: fill out coverage for new fsck features 2020-08-17 23:27:32 -04:00
10b34f5937 Fix issue with test suite and empty dirs on git
Git doesn't save empty dirs, so put a placeholder there that is
ignored when the test data is copied to its final location during
testing.
2020-08-07 10:49:29 -04:00
83daeb148a Add fsck scan for any data timestamps outside interval range 2020-08-07 10:25:22 -04:00
d65f00e8b2 Add fsck to default tests 2020-08-07 02:56:49 -04:00
bcd21b3498 Improve fsck test coverage to 100% 2020-08-07 02:54:45 -04:00
a1dee0e6f2 Improve fsck test coverage to 85% 2020-08-07 01:26:30 -04:00
99ac47cf0d Start implementing fsck test and porting fsck to Python 3 2020-08-07 00:11:45 -04:00
6cc1f6b7b2 Fix #! at top of shell scripts for py3 and venvs 2020-08-05 17:02:30 -04:00
b20bb92988 Improve test coverage and remove the last "#pragma: no cover"
We now have full coverage of the main code.
2019-08-30 13:52:13 -04:00
ea67e45be9 Clean up how we handle cherrypy's calls of os._exit(70)
With this solution, we can catch it cleanly in the standalone
nilmdb-server, and test the error paths in our normal test suite.
2019-08-30 11:59:52 -04:00
4ff4b263b4 Fill out code coverage for nilmdb/server/bulkdata.py 2019-08-30 11:14:06 -04:00
9acf99ff25 Fill out coverage for server/nilmdb.py and remove dead code 2019-08-30 10:32:52 -04:00
4958a5ab2e Improve test coverage 2019-08-30 01:28:16 -04:00
f2d89e2da5 Remove very outdated pytables tests 2019-08-30 01:28:03 -04:00
1952f245c0 Try to clean up some issues with cherrypy startup and os._exit
This is hard and finicky to test, so there's unfortunately not a clear
way to get 100% test coverage in cherrypy_start.  However, that
function is only used in the test suite and the standalone
nilmdb-server script, not in production (which goes through wsgi and
skips all this cherrypy server stuff entirely).
2019-08-30 01:21:37 -04:00
9126980ed4 Add tests for bash completion; fix Unicode bug that turned up
Note that argcomplete is also now required.
2019-08-30 00:15:29 -04:00
ea051c85b3 Improve test coverage for CORS_allow 2019-08-30 00:15:29 -04:00
d8294469cf Fix diskusage test coverage 2019-08-30 00:15:29 -04:00
96eadb0577 Add test for WSGI server, and fix a str/bytes bug that it found 2019-08-30 00:15:29 -04:00
0b631b7dea Use built-in json module rather than external simplejson
simplejson was there for python <= 2.6 compatibility.
It's not needed now, and installing it with pip can lead to segfaults
because pip is dumb.
(see e.g. https://github.com/simplejson/simplejson/issues/114)
2019-08-28 18:17:55 -04:00
f587518adb Improve test coverage 2019-08-26 17:22:43 -04:00
efbb2665fe Improve test coverage 2019-08-26 17:08:00 -04:00
544413018c Add some thread safety tests
We don't actually use nilmdb.utils.threadsafety.verify_proxy in the
main NilmDB code, but it's useful for finding errors.

It found an issue with __getattr__ in SerializerProxy which
(1) can't be avoided?
(2) is now commented in the code
(3) shouldn't matter in real use
2019-08-26 16:19:26 -04:00
322b0ec423 Remove impossible error in serializer and test with a C module 2019-08-26 15:40:07 -04:00
f3833d9b20 Use pip fallocate package rather than hand-rolling 2019-08-26 15:34:14 -04:00
caa5604d81 Improve code coverage 2019-08-26 14:58:28 -04:00
6624e8dab6 Remove another "no cover" 2019-08-23 16:41:29 -04:00
39e66fe38c Test exclusive_lock better 2019-08-23 16:23:15 -04:00
ba915bb290 Use os.replace instead of os.remove; remove a "no cover" 2019-08-23 16:23:07 -04:00
3f0b8e50a2 Split off misc tests; add coverage for failure case in exclusive_lock 2019-08-23 16:04:42 -04:00
087fb39475 Add tests for two more "no cover" blocks 2019-08-23 16:03:59 -04:00
8b4acf41d6 Test previously untested code 2019-08-23 15:24:47 -04:00
2764283f59 Improve test coverage 2019-08-14 19:27:33 -04:00
2d0c3f7868 Improve test coverage for interval.py 2019-08-14 19:24:33 -04:00
2d200a86c9 Improve test coverage 2019-08-14 18:56:40 -04:00
02ee18c410 Improve test coverage 2019-08-14 18:22:55 -04:00
d1e241a213 Test calling NilmDB.close twice to improve coverage 2019-08-14 18:22:50 -04:00
c58a933d21 Improve branch coverage 2019-08-14 18:06:57 -04:00
7874e1ebfa Improve coverage 2019-08-14 18:02:54 -04:00
6645395924 Improve branch coverage for numpyclient 2019-08-14 14:00:14 -04:00
edf4568e8f Fix error in interval comparisons; add coverage 2019-08-14 13:42:39 -04:00
349eec3942 Improve coverage for client 2019-08-14 13:33:50 -04:00
54eccb17aa Adjust test for new argparse output 2019-08-13 16:08:52 -04:00
cc8ac74a37 Put good and bad UTF-8 into one of the test data files 2019-08-13 16:08:39 -04:00
5d9fc5500c Make httpclient.put take a content-type instead of picking one
No reason to push the content-type decision into httpclient
2019-08-13 16:07:00 -04:00
57751f5b32 Consistently use bytes everywhere for stream data
Previous commits went back and forth a bit on whether the various APIs
should use bytes or strings, but bytes appears to be a better answer,
because actual data in streams will always be 7-bit ASCII or raw
binary.  There's no reason to apply the performance penalty of
constantly converting between bytes and strings.

One drawback now is that lots of code now has to have "b" prefixes on
strings, especially in tests, which inflates this commit quite a bit.
2019-08-13 15:53:05 -04:00
6d673bd2be Fix commandline test character encoding issues for Py3 2019-08-01 17:38:01 -04:00