diff options
| author | jvoisin | 2018-04-04 21:59:46 +0200 |
|---|---|---|
| committer | jvoisin | 2018-04-04 21:59:46 +0200 |
| commit | 4ee091d833b55932fec345cc7403ef3723ecbd2f (patch) | |
| tree | 988bd7f50cdf32e34ff4418246461032fee29af9 /tests/test_climat2.py | |
| parent | 1ad817566de019521f565f4a7542f91b97c8a7a4 (diff) | |
Improve get_meta in various ways
- Normalize the case
- Strip \00, \r, space and \n
- Flatten metadata lists
- Add tests for audio files
Diffstat (limited to '')
| -rw-r--r-- | tests/test_climat2.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_climat2.py b/tests/test_climat2.py index 16f97a2..cf7a63b 100644 --- a/tests/test_climat2.py +++ b/tests/test_climat2.py | |||
| @@ -43,3 +43,27 @@ class TestGetMeta(unittest.TestCase): | |||
| 43 | self.assertIn(b'generator: LibreOffice/3.3$Unix', stdout) | 43 | self.assertIn(b'generator: LibreOffice/3.3$Unix', stdout) |
| 44 | self.assertIn(b'creator: jvoisin', stdout) | 44 | self.assertIn(b'creator: jvoisin', stdout) |
| 45 | self.assertIn(b'date_time: 2011-07-26 02:40:16', stdout) | 45 | self.assertIn(b'date_time: 2011-07-26 02:40:16', stdout) |
| 46 | |||
| 47 | def test_mp3(self): | ||
| 48 | proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.mp3'], | ||
| 49 | stdout=subprocess.PIPE) | ||
| 50 | stdout, _ = proc.communicate() | ||
| 51 | self.assertIn(b'TALB: harmfull', stdout) | ||
| 52 | self.assertIn(b'COMM::: Thank you for using MAT !', stdout) | ||
| 53 | |||
| 54 | def test_flac(self): | ||
| 55 | proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.flac'], | ||
| 56 | stdout=subprocess.PIPE) | ||
| 57 | stdout, _ = proc.communicate() | ||
| 58 | self.assertIn(b'comments: Thank you for using MAT !', stdout) | ||
| 59 | self.assertIn(b'genre: Python', stdout) | ||
| 60 | self.assertIn(b'title: I am so', stdout) | ||
| 61 | |||
| 62 | def test_ogg(self): | ||
| 63 | proc = subprocess.Popen(['./main.py', '--show', './tests/data/dirty.ogg'], | ||
| 64 | stdout=subprocess.PIPE) | ||
| 65 | stdout, _ = proc.communicate() | ||
| 66 | self.assertIn(b'comments: Thank you for using MAT !', stdout) | ||
| 67 | self.assertIn(b'genre: Python', stdout) | ||
| 68 | self.assertIn(b'i am a : various comment', stdout) | ||
| 69 | self.assertIn(b'artist: jvoisin', stdout) | ||
