Esempio n. 1
0
 def test_get_command_with_custom_output_stream(self):
     output = StringIO()
     command = get_command([
         "txaws-discover", "--key", "key", "--secret", "secret",
         "--endpoint", "endpoint", "--action", "action"
     ], output)
     self.assertIdentical(output, command.output)
Esempio n. 2
0
 def test_get_command_passes_additional_parameters_to_command(self):
     """
     Command-line parameters beyond C{--key}, C{--secret}, C{--endpoint}
     and C{--action} are passed to the L{Command} in a parameter C{dict}.
     """
     command = get_command([
         "txaws-discover", "--key", "key", "--secret", "secret",
         "--endpoint", "endpoint", "--action", "DescribeRegions",
         "--Region.Name.0", "us-west-1"])
     self.assertEqual({"Region.Name.0": "us-west-1"}, command.parameters)
Esempio n. 3
0
 def test_get_command_passes_additional_parameters_to_command(self):
     """
     Command-line parameters beyond C{--key}, C{--secret}, C{--endpoint}
     and C{--action} are passed to the L{Command} in a parameter C{dict}.
     """
     command = get_command([
         "txaws-discover", "--key", "key", "--secret", "secret",
         "--endpoint", "endpoint", "--action", "DescribeRegions",
         "--Region.Name.0", "us-west-1"
     ])
     self.assertEqual({"Region.Name.0": "us-west-1"}, command.parameters)
Esempio n. 4
0
 def test_get_command(self):
     """
     An access key, access secret, endpoint and action can be specified as
     command-line arguments.
     """
     command = get_command([
         "txaws-discover", "--key", "key", "--secret", "secret",
         "--endpoint", "endpoint", "--action", "action"])
     self.assertEqual("key", command.key)
     self.assertEqual("secret", command.secret)
     self.assertEqual("endpoint", command.endpoint)
     self.assertEqual("action", command.action)
     self.assertIdentical(sys.stdout, command.output)
Esempio n. 5
0
 def test_get_command(self):
     """
     An access key, access secret, endpoint and action can be specified as
     command-line arguments.
     """
     command = get_command([
         "txaws-discover", "--key", "key", "--secret", "secret",
         "--endpoint", "endpoint", "--action", "action"
     ])
     self.assertEqual("key", command.key)
     self.assertEqual("secret", command.secret)
     self.assertEqual("endpoint", command.endpoint)
     self.assertEqual("action", command.action)
     self.assertIdentical(sys.stdout, command.output)
Esempio n. 6
0
 def test_get_command_with_custom_output_stream(self):
     output = StringIO()
     command = get_command([
         "txaws-discover", "--key", "key", "--secret", "secret",
         "--endpoint", "endpoint", "--action", "action"], output)
     self.assertIdentical(output, command.output)