def test_get_track_count(monkeypatch, albumdata):
    """Test track count getting with a fake cdparanoia output."""
    testdata = """\
cdparanoia III release 10.2 (September 11, 2008)


Table of contents (audio tracks only):
track        length               begin        copy pre ch
===========================================================
  1.    1000 [00:10.00]        150 [00:01.50]    no   no  2
TOTAL   1150 [00:11.50]        (audio only)
"""
    class FakeProcess:
        def check_returncode(self):
            pass
        
        @property
        def stdout(self):
            return testdata

    obj = FakeProcess()
    monkeypatch.setattr('subprocess.run', lambda *x, **y: obj)
    assert albumdata.Albumdata._get_track_count('') == 1