Exemplo n.º 1
0
    def test_run(self):
        """Test that specifying input and passing an argument to the CLI sets
        the correct attribute."""
        parser = cli.create_parser()
        args = parser.parse_args(['run', 'SomePath'])

        assert args.func is cli.run_blackbird_script
        assert args.input == 'SomePath'
Exemplo n.º 2
0
    def test_configuration_wizard_locally(self, option):
        """Test that specifying configure, --local to the CLI sets the correct
        attribute."""
        parser = cli.create_parser()
        args = parser.parse_args(['configure', option])

        assert args.func is cli.configure
        assert args.local
Exemplo n.º 3
0
    def test_configure_token_locally(self, token_option, local_option):
        """Test that specifying configure, --token, --local and passing an argument to
        the CLI sets the correct attribute."""
        parser = cli.create_parser()

        args = parser.parse_args(['configure', token_option, 'SomeToken', local_option])
        assert args.func is cli.configure
        assert args.token == 'SomeToken'
Exemplo n.º 4
0
    def test_output(self):
        """Test that specifying input, --output and passing the arguments to
        the CLI sets the correct attributes."""
        parser = cli.create_parser()
        args = parser.parse_args(['run', 'SomeInputPath', '--output', 'SomeOutputPath'])

        assert args.func is cli.run_blackbird_script
        assert args.input == 'SomeInputPath'
        assert args.output == 'SomeOutputPath'
Exemplo n.º 5
0
    def test_ping(self, option):
        """Test that specifying --ping to the CLI sets the correct attribute."""
        parser = cli.create_parser()

        args = parser.parse_args([option])
        assert args.ping
Exemplo n.º 6
0
 def test_general_details(self):
     """Test the general details of the parser created."""
     parser = cli.create_parser()
     assert parser._optionals.title == "General Options"
     assert parser.description == "See below for available options and commands for working with the Xanadu cloud platform."
     assert parser.add_help