Browse Source

[WIP] Test of patatools commands

pull/189/head
Louis 9 years ago
parent
commit
bd94153bc4
  1. 1
      test/test_patatools/.gitignore
  2. 0
      test/test_patatools/__init__.py
  3. 41
      test/test_patatools/test_cache.py
  4. 3
      test/test_patatools/test_cache.sb
  5. 0
      test/test_patatools/test_cache_datadir/songs/foo.csg
  6. 0
      test/test_patatools/test_convert.py

1
test/test_patatools/.gitignore

@ -0,0 +1 @@
.cache

0
test/test_patatools/__init__.py

41
test/test_patatools/test_cache.py

@ -0,0 +1,41 @@
"""Tests of the patatools-convert command."""
# pylint: disable=too-few-public-methods
import os
import shutil
import unittest
from patacrep.tools import convert
CACHEDIR = os.path.join(os.path.dirname(__file__), "test_cache_datadir", "songs", ".cache")
class TestCache(unittest.TestCase):
"""Test of the "patatools cache" subcommand"""
def setUp(self):
"""Remove cache."""
self._remove_cache()
def tearDown(self):
"""Remove cache."""
self._remove_cache()
def _remove_cache(self):
"""Delete cache."""
shutil.rmtree(CACHEDIR, ignore_errors=True)
def test_clean(self):
"""Test of the "patatools cache clean" subcommand"""
# Cache does not exist
self.assertFalse(os.path.exists(CACHEDIR))
# First compilation. Ensure that cache exists afterwards
TODO
self.assertTrue(os.path.exists(CACHEDIR))
# Clean cache
TODO
# Ensure that cache does not exist
self.assertFalse(os.path.exists(CACHEDIR))

3
test/test_patatools/test_cache.sb

@ -0,0 +1,3 @@
{
"datadir": ["test_cache_datadir"],
}

0
test/test_patatools/test_cache_datadir/songs/foo.csg

0
test/test_patatools/test_convert.py

Loading…
Cancel
Save