File: test_close.py

package info (click to toggle)
pytaglib 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,136 kB
  • sloc: python: 429; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest


def test_properties_fail_after_close(test_file):
    tf = test_file("r2.mp3")
    tf.close()
    with pytest.raises(ValueError):
        _ = tf.readOnly
    with pytest.raises(ValueError):
        _ = tf.bitrate
    with pytest.raises(ValueError):
        _ = tf.length
    with pytest.raises(ValueError):
        _ = tf.channels
    with pytest.raises(ValueError):
        _ = tf.sampleRate


def test_close_fails_after_close(test_file):
    tf = test_file("r2.mp3")
    tf.close()
    with pytest.raises(ValueError):
        tf.close()