def test_with_default_filter(self):
     piplicenses.get_installed_distributions = \
         get_installed_distributions_mocked
     args = self.parser.parse_args(["--filter-strings"])
     packages = list(piplicenses.get_packages(args))
     piplicenses.get_installed_distributions = \
         get_installed_distributions_orig
     self.assertNotIn(UNICODE_APPENDIX, packages[-1]["name"])
 def test_with_specified_filter(self):
     piplicenses.get_installed_distributions = \
         get_installed_distributions_mocked
     args = self.parser.parse_args(
         ["--filter-strings", "--filter-code-page=ascii"])
     packages = list(piplicenses.get_packages(args))
     self.assertNotIn(UNICODE_APPENDIX, packages[-1]["summary"])
     piplicenses.get_installed_distributions = \
         get_installed_distributions_orig
Esempio n. 3
0
 def test_with_default_filter(self):
     args = self.parser.parse_args(["--filter-strings"])
     packages = list(piplicenses.get_packages(args))
     self.assertNotIn(UNICODE_APPENDIX, packages[-1]["name"])
Esempio n. 4
0
 def test_without_filter(self):
     args = self.parser.parse_args([])
     packages = list(piplicenses.get_packages(args))
     self.assertIn(UNICODE_APPENDIX, packages[-1]["name"])