def test_loadCustomStyles_empty_dirs(self): for n in range(5): dirname = mkdtemp() self._tmp_dirs.append(dirname) styles = loadCustomStyles(self._tmp_dirs) self.assertEqual(styles, {})
def test_loadCustomStyles_single_dir(self): dirname = mkdtemp() self._tmp_dirs.append(dirname) writeTextFile(os.path.join(dirname, 'style-1.css'), 'test-1') writeTextFile(os.path.join(dirname, 'style-2.css'), 'test-2') writeTextFile(os.path.join(dirname, 'style-3.css'), 'test-3') styles = loadCustomStyles(self._tmp_dirs) self.assertEqual(styles, {'style-1': 'test-1', 'style-2': 'test-2', 'style-3': 'test-3', })
def test_loadCustomStyles_more_dirs_repeat_names(self): dirname_1 = mkdtemp() dirname_2 = mkdtemp() self._tmp_dirs.append(dirname_1) self._tmp_dirs.append(dirname_2) writeTextFile(os.path.join(dirname_1, 'style-1.css'), 'test-1') writeTextFile(os.path.join(dirname_1, 'style-2.css'), 'test-2') writeTextFile(os.path.join(dirname_1, 'style-3.css'), 'test-3') writeTextFile(os.path.join(dirname_2, 'style-1.css'), 'test-1-new') writeTextFile(os.path.join(dirname_2, 'style-5.css'), 'test-5') styles = loadCustomStyles(self._tmp_dirs) self.assertEqual(styles, {'style-1': 'test-1-new', 'style-2': 'test-2', 'style-3': 'test-3', 'style-5': 'test-5', })
def test_loadCustomStyles_empty(self): styles = loadCustomStyles(self._tmp_dirs) self.assertEqual(styles, {})