test cleanup
Peter Molnar hello@petermolnar.eu
Mon, 03 Dec 2018 10:29:15 +0000
3 files changed,
24 insertions(+),
5 deletions(-)
M
settings.py
→
settings.py
@@ -22,7 +22,6 @@
categorydisplay = { 'article': 'flat', 'journal': 'flat', - 'photo': 'gallery', } licence = {
M
tests.py
→
tests.py
@@ -34,14 +34,34 @@
def test_singular_tags(self): self.assertEqual( self.singular.tags, - ['Llyn Idwal', 'winter', 'spring', 'cloudy', 'Snowdonia', 'mountain', 'clouds', 'lake', 'mountains', 'snow', 'Wales', 'water'] + [ + 'Llyn Idwal', + 'winter', + 'spring', + 'cloudy', + 'Snowdonia', + 'mountain', + 'clouds', + 'lake', + 'mountains', + 'snow', + 'Wales', + 'water' + ] ) class TestExiftool(unittest.TestCase): def test_exiftool(self): - with open('tests/.tests.jpg.json', 'rt') as expected: + if os.path.exists('tests/.Exif.tests.jpg.json'): + os.unlink('tests/.Exif.tests.jpg.json') + with open('tests/tests.jpg.json', 'rt') as expected: o = json.loads(expected.read()) self.assertEqual(exiftool.Exif('tests/tests.jpg'), o) + self.assertTrue(os.path.exists('tests/.Exif.tests.jpg.json')) + self.assertTrue( + os.path.getmtime('tests/.Exif.tests.jpg.json') > + os.path.getmtime('tests/tests.jpg.json') + ) class TestPandoc(unittest.TestCase): def test_pandoc(self):
M
tests/.tests.jpg.json
→
tests/tests.jpg.json
@@ -8,7 +8,7 @@ "Description": "One can always wish for the perfect weather, yet most of the times, it remains a wish. Not this time.\n\nThere is a National Trust recommendation to visit Llyn Idwal, which Nora[^1] spotted, and they were right about the place: it's magnificent. We really weren't expecting snow on the mountains in May, but that, combined with the clouds and the late afternoon sunshine was just perfect.\n\nI cropped the image, but apart from that, it really looked like this. No edits, no nothing.\n\n[^1]: https://norahamucska.eu",
"ExposureTime": "1/320", "FNumber": 11.0, "FOV": "67.4 deg", - "FileName": "llyn-idwal.jpg", + "FileName": "tests.jpg", "FileSize": 29123, "FileType": "JPEG", "FocalLength": "18.0 mm",@@ -25,5 +25,5 @@ "MIMEType": "image/jpeg",
"Model": "PENTAX K-5 II s", "ModifyDate": "2016-05-01T00:08:24+00:00", "ReleaseDate": "2016-07-23T09:00:23+00:00", - "SourceFile": "tests/llyn-idwal.jpg" + "SourceFile": "tests/tests.jpg" }