def test_getCustomStylesNames_empty_dirs(self): for n in range(5): dirname = mkdtemp() self._tmp_dirs.append(dirname) styles = getCustomStylesNames(self._tmp_dirs) self.assertEqual(styles, [])
def test_getCustomStylesNames_empty_dirs(self): for n in range(5): dirname = mkdtemp() self._tmp_dirs.append(dirname) styles = getCustomStylesNames(self._tmp_dirs) self.assertEqual(styles, [])
def test_getCustomStylesNames_single_dir(self): dirname = mkdtemp() self._tmp_dirs.append(dirname) writeTextFile(os.path.join(dirname, 'style-1.css'), '') writeTextFile(os.path.join(dirname, 'style-2.css'), '') writeTextFile(os.path.join(dirname, 'style-3.css'), '') styles = sorted(getCustomStylesNames(self._tmp_dirs)) self.assertEqual(styles, ['style-1', 'style-2', 'style-3'])
def test_getCustomStylesNames_single_dir(self): dirname = mkdtemp() self._tmp_dirs.append(dirname) writeTextFile(os.path.join(dirname, 'style-1.css'), '') writeTextFile(os.path.join(dirname, 'style-2.css'), '') writeTextFile(os.path.join(dirname, 'style-3.css'), '') styles = sorted(getCustomStylesNames(self._tmp_dirs)) self.assertEqual(styles, ['style-1', 'style-2', 'style-3'])
def test_getCustomStylesNames_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'), '') writeTextFile(os.path.join(dirname_1, 'style-2.css'), '') writeTextFile(os.path.join(dirname_1, 'style-3.css'), '') writeTextFile(os.path.join(dirname_2, 'style-1.css'), '') writeTextFile(os.path.join(dirname_2, 'style-5.css'), '') styles = sorted(getCustomStylesNames(self._tmp_dirs)) self.assertEqual(styles, ['style-1', 'style-2', 'style-3', 'style-5'])
def test_getCustomStylesNames_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'), '') writeTextFile(os.path.join(dirname_1, 'style-2.css'), '') writeTextFile(os.path.join(dirname_1, 'style-3.css'), '') writeTextFile(os.path.join(dirname_2, 'style-1.css'), '') writeTextFile(os.path.join(dirname_2, 'style-5.css'), '') styles = sorted(getCustomStylesNames(self._tmp_dirs)) self.assertEqual(styles, ['style-1', 'style-2', 'style-3', 'style-5'])
def test_getCustomStylesNames_empty(self): styles = getCustomStylesNames(self._tmp_dirs) self.assertEqual(styles, [])
def test_getCustomStylesNames_empty(self): styles = getCustomStylesNames(self._tmp_dirs) self.assertEqual(styles, [])