Jim Paris
517b237636
tests: fix test databases
2 years ago
Jim Paris
7538c6201b
tests: new fsck tests for interval overlap
2 years ago
Jim Paris
7056c5b4ec
tests: new fsck tests
2 years ago
Jim Paris
d4003d0d34
tests: fill out coverage for new fsck features
2 years ago
Jim Paris
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.
2 years ago
Jim Paris
83daeb148a
Add fsck scan for any data timestamps outside interval range
2 years ago
Jim Paris
d65f00e8b2
Add fsck to default tests
2 years ago
Jim Paris
bcd21b3498
Improve fsck test coverage to 100%
2 years ago
Jim Paris
a1dee0e6f2
Improve fsck test coverage to 85%
2 years ago
Jim Paris
99ac47cf0d
Start implementing fsck test and porting fsck to Python 3
2 years ago
Jim Paris
6cc1f6b7b2
Fix #! at top of shell scripts for py3 and venvs
2 years ago
Jim Paris
b20bb92988
Improve test coverage and remove the last "#pragma: no cover"
We now have full coverage of the main code.
3 years ago
Jim Paris
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.
3 years ago
Jim Paris
4ff4b263b4
Fill out code coverage for nilmdb/server/bulkdata.py
3 years ago
Jim Paris
9acf99ff25
Fill out coverage for server/nilmdb.py and remove dead code
3 years ago
Jim Paris
4958a5ab2e
Improve test coverage
3 years ago
Jim Paris
f2d89e2da5
Remove very outdated pytables tests
3 years ago
Jim Paris
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).
3 years ago
Jim Paris
9126980ed4
Add tests for bash completion; fix Unicode bug that turned up
Note that argcomplete is also now required.
3 years ago
Jim Paris
ea051c85b3
Improve test coverage for CORS_allow
3 years ago
Jim Paris
d8294469cf
Fix diskusage test coverage
3 years ago
Jim Paris
96eadb0577
Add test for WSGI server, and fix a str/bytes bug that it found
3 years ago
Jim Paris
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 )
3 years ago
Jim Paris
f587518adb
Improve test coverage
3 years ago
Jim Paris
efbb2665fe
Improve test coverage
3 years ago
Jim Paris
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
3 years ago
Jim Paris
322b0ec423
Remove impossible error in serializer and test with a C module
3 years ago
Jim Paris
f3833d9b20
Use pip fallocate package rather than hand-rolling
3 years ago
Jim Paris
caa5604d81
Improve code coverage
3 years ago
Jim Paris
6624e8dab6
Remove another "no cover"
3 years ago
Jim Paris
39e66fe38c
Test exclusive_lock better
3 years ago
Jim Paris
ba915bb290
Use os.replace instead of os.remove; remove a "no cover"
3 years ago
Jim Paris
3f0b8e50a2
Split off misc tests; add coverage for failure case in exclusive_lock
3 years ago
Jim Paris
087fb39475
Add tests for two more "no cover" blocks
3 years ago
Jim Paris
8b4acf41d6
Test previously untested code
3 years ago
Jim Paris
2764283f59
Improve test coverage
3 years ago
Jim Paris
2d0c3f7868
Improve test coverage for interval.py
3 years ago
Jim Paris
2d200a86c9
Improve test coverage
3 years ago
Jim Paris
02ee18c410
Improve test coverage
3 years ago
Jim Paris
d1e241a213
Test calling NilmDB.close twice to improve coverage
3 years ago
Jim Paris
c58a933d21
Improve branch coverage
3 years ago
Jim Paris
7874e1ebfa
Improve coverage
3 years ago
Jim Paris
6645395924
Improve branch coverage for numpyclient
3 years ago
Jim Paris
edf4568e8f
Fix error in interval comparisons; add coverage
3 years ago
Jim Paris
349eec3942
Improve coverage for client
3 years ago
Jim Paris
54eccb17aa
Adjust test for new argparse output
3 years ago
Jim Paris
cc8ac74a37
Put good and bad UTF-8 into one of the test data files
3 years ago
Jim Paris
5d9fc5500c
Make httpclient.put take a content-type instead of picking one
No reason to push the content-type decision into httpclient
3 years ago
Jim Paris
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.
3 years ago
Jim Paris
6d673bd2be
Fix commandline test character encoding issues for Py3
3 years ago