コード例 #1
0
class TestWaitCommand(unittest.TestCase):
    def setUp(self):
        self.model = WaiterModel({
            'version': 2,
            'waiters': {
                'Foo': {
                    'operation': 'foo',
                    'maxAttempts': 1,
                    'delay': 1,
                    'acceptors': [],
                }
            }
        })
        self.service_object = mock.Mock()
        self.cmd = WaitCommand(self.model, self.service_object)

    def test_passes_on_lineage(self):
        child_cmd = self.cmd.subcommand_table['foo']
        self.assertEqual(len(child_cmd.lineage), 2)
        self.assertEqual(child_cmd.lineage[0], self.cmd)
        self.assertIsInstance(child_cmd.lineage[1], WaiterStateCommand)

    def test_run_main_error(self):
        self.parsed_args = mock.Mock()
        self.parsed_args.subcommand = None
        with self.assertRaises(ValueError):
            self.cmd._run_main(self.parsed_args, None)
コード例 #2
0
ファイル: test_waiters.py プロジェクト: hardiku/aws-cli
class TestWaitCommand(unittest.TestCase):
    def setUp(self):
        self.model = WaiterModel({
            'version': 2,
            'waiters': {
                'Foo': {
                    'operation': 'foo', 'maxAttempts': 1, 'delay': 1,
                    'acceptors': [],
                }
            }
        })
        self.service_object = mock.Mock()
        self.cmd = WaitCommand(self.model, self.service_object)

    def test_passes_on_lineage(self):
        child_cmd = self.cmd.subcommand_table['foo']
        self.assertEqual(len(child_cmd.lineage), 2)
        self.assertEqual(child_cmd.lineage[0], self.cmd) 
        self.assertIsInstance(child_cmd.lineage[1], WaiterStateCommand)

    def test_run_main_error(self):
        self.parsed_args = mock.Mock()
        self.parsed_args.subcommand = None
        with self.assertRaises(ValueError):
            self.cmd._run_main(self.parsed_args, None)
コード例 #3
0
ファイル: test_waiters.py プロジェクト: wenhuanhuang/aws-cli
 def setUp(self):
     self.model = WaiterModel({
         'version': 2,
         'waiters': {
             'Foo': {
                 'operation': 'foo', 'maxAttempts': 1, 'delay': 1,
                 'acceptors': [],
             }
         }
     })
     self.service_object = mock.Mock()
     self.cmd = WaitCommand(self.model, self.service_object)
コード例 #4
0
ファイル: test_waiters.py プロジェクト: mtdowling/aws-cli
 def setUp(self):
     self.session = mock.Mock()
     self.model = WaiterModel(
         {"version": 2, "waiters": {"Foo": {"operation": "foo", "maxAttempts": 1, "delay": 1, "acceptors": []}}}
     )
     self.service_model = mock.Mock()
     self.cmd = WaitCommand(self.session, self.model, self.service_model)
コード例 #5
0
ファイル: test_waiters.py プロジェクト: wenhuanhuang/aws-cli
class TestWaitCommand(unittest.TestCase):
    def setUp(self):
        self.model = WaiterModel({
            'version': 2,
            'waiters': {
                'Foo': {
                    'operation': 'foo', 'maxAttempts': 1, 'delay': 1,
                    'acceptors': [],
                }
            }
        })
        self.service_object = mock.Mock()
        self.cmd = WaitCommand(self.model, self.service_object)

    def test_run_main_error(self):
        self.parsed_args = mock.Mock()
        self.parsed_args.subcommand = None
        with self.assertRaises(ValueError):
            self.cmd._run_main(self.parsed_args, None)
コード例 #6
0
ファイル: test_waiters.py プロジェクト: mtdowling/aws-cli
class TestWaitCommand(unittest.TestCase):
    def setUp(self):
        self.session = mock.Mock()
        self.model = WaiterModel(
            {"version": 2, "waiters": {"Foo": {"operation": "foo", "maxAttempts": 1, "delay": 1, "acceptors": []}}}
        )
        self.service_model = mock.Mock()
        self.cmd = WaitCommand(self.session, self.model, self.service_model)

    def test_passes_on_lineage(self):
        child_cmd = self.cmd.subcommand_table["foo"]
        self.assertEqual(len(child_cmd.lineage), 2)
        self.assertEqual(child_cmd.lineage[0], self.cmd)
        self.assertIsInstance(child_cmd.lineage[1], WaiterStateCommand)

    def test_run_main_error(self):
        self.parsed_args = mock.Mock()
        self.parsed_args.subcommand = None
        with self.assertRaises(ValueError):
            self.cmd._run_main(self.parsed_args, None)