def test_is_distutils_logs_pkg_info_file_found(self): is_distutils(self._distutils_pkg_info()) expected = ['setup.py file found.', 'PKG-INFO file found.'] self.assertEqual(expected, self.get_logs(logging.DEBUG))
def test_is_distutils_logs_setup_py_text_found(self): is_distutils(self._distutils_setup_py_pkg()) expected = ['setup.py file found.', 'No PKG-INFO file found.', 'Found distutils text in setup.py.'] self.assertEqual(expected, self.get_logs(logging.DEBUG))
def test_is_distutils_logs_setup_py_text_not_found(self): directory = self._random_setup_py_pkg() is_distutils(directory) expected = ['setup.py file found.', 'No PKG-INFO file found.', 'No distutils text found in setup.py.'] self.assertEqual(expected, self.get_logs(logging.DEBUG))
def test_setup_py_not_importing_distutils_is_not_distutils_based(self): self.assertFalse(is_distutils(self._random_setup_py_pkg()))
def test_pkg_info_and_non_distutils_setup_py_is_distutils_based(self): self.assertTrue(is_distutils(self._pkg_info_with_no_distutils()))
def test_pkg_info_file_and_setup_py_is_distutils_based(self): self.assertTrue(is_distutils(self._distutils_pkg_info()))
def test_setup_py_importing_distutils_is_distutils_based(self): self.assertTrue(is_distutils(self._distutils_setup_py_pkg()))
def test_empty_package_is_not_based_on_anything(self): self.assertFalse(is_setuptools(self._empty_dir)) self.assertFalse(is_distutils(self._empty_dir)) self.assertFalse(is_packaging(self._empty_dir))