comparison tests/test_data_assetor.py @ 1115:11b9d0c8bd62

tests: Fix assetor tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 24 Feb 2018 21:13:54 -0800
parents 45ad976712ec
children
comparison
equal deleted inserted replaced
1114:8af2ea1f5c34 1115:11b9d0c8bd62
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 en in assetor
44 assert hasattr(assetor, en) 44 assert hasattr(assetor, en)
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 str(assetor[en]) == path
47 assert getattr(assetor, en) == path 47 assert str(getattr(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()