Mercurial > piecrust2
comparison tests/test_data_assetor.py @ 979:45ad976712ec
tests: Big push to get the tests to pass again.
- Lots of fixes everywhere in the code.
- Try to handle debug logging in the multiprocessing worker pool when running in pytest. Not perfect, but usable for now.
- Replace all `.md` test files with `.html` since now a auto-format extension always sets the format.
- Replace `out` with `outfiles` in most places since now blog archives are added to the bake output and I don't want to add expected outputs for blog archives everywhere.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 29 Oct 2017 22:51:57 -0700 |
parents | 72f17534d58e |
children | 11b9d0c8bd62 |
comparison
equal
deleted
inserted
replaced
978:7e51d14097cb | 979:45ad976712ec |
---|---|
38 app.config.set('site/asset_url_format', '%page_uri%/%filename%') | 38 app.config.set('site/asset_url_format', '%page_uri%/%filename%') |
39 page = get_simple_page(app, 'foo/bar') | 39 page = get_simple_page(app, 'foo/bar') |
40 | 40 |
41 assetor = Assetor(page) | 41 assetor = Assetor(page) |
42 for en in expected.keys(): | 42 for en in expected.keys(): |
43 assert en in assetor | |
43 assert hasattr(assetor, en) | 44 assert hasattr(assetor, en) |
44 assert en in assetor | |
45 path = site_root.rstrip('/') + '/foo/bar/%s.txt' % en | 45 path = site_root.rstrip('/') + '/foo/bar/%s.txt' % en |
46 assert assetor[en] == path | |
46 assert getattr(assetor, en) == path | 47 assert getattr(assetor, en) == path |
47 assert assetor[en] == path | |
48 | 48 |
49 | 49 |
50 def test_missing_asset(): | 50 def test_missing_asset(): |
51 with pytest.raises(KeyError): | 51 with pytest.raises(KeyError): |
52 fs = (mock_fs() | 52 fs = (mock_fs() |