def test_parse_arguments(self):
        """
        Test parse arguments method for update_asset command.
        """
        # make sure update_assets picks all themes when called with 'themes=all' option
        parsed_args = Command.parse_arguments(themes=["all"])
        self.assertEqual(parsed_args[0], get_themes())

        # make sure update_assets picks no themes when called with 'themes=no' option
        parsed_args = Command.parse_arguments(themes=["no"])
        self.assertEqual(parsed_args[0], [])

        # make sure update_assets picks only specified themes
        parsed_args = Command.parse_arguments(themes=["test-theme"])
        self.assertEqual(parsed_args[0], [theme for theme in get_themes() if theme.theme_dir == "test-theme"])
Ejemplo n.º 2
0
    def test_parse_arguments(self):
        """
        Test parse arguments method for update_asset command.
        """
        # make sure update_assets picks all themes when called with 'themes=all' option
        parsed_args = Command.parse_arguments(themes=["all"])
        self.assertEqual(parsed_args[0], get_themes())

        # make sure update_assets picks no themes when called with 'themes=no' option
        parsed_args = Command.parse_arguments(themes=["no"])
        self.assertEqual(parsed_args[0], [])

        # make sure update_assets picks only specified themes
        parsed_args = Command.parse_arguments(themes=["test-theme"])
        self.assertEqual(parsed_args[0], [theme for theme in get_themes() if theme.theme_dir_name == "test-theme"])