Пример #1
0
 def test_iam_policy(self, capsys):
     expected = {"baz": "blam", "foo": "bar"}
     mock_checker = Mock(spec_set=AwsLimitChecker)
     mock_checker.get_required_iam_policy.return_value = {
         'foo': 'bar',
         'baz': 'blam',
     }
     self.cls.checker = mock_checker
     self.cls.iam_policy()
     out, err = capsys.readouterr()
     assert json.loads(out) == expected
     assert mock_checker.mock_calls == [call.get_required_iam_policy()]
 def test_iam_policy(self, capsys):
     expected = {"baz": "blam", "foo": "bar"}
     mock_checker = Mock(spec_set=AwsLimitChecker)
     mock_checker.get_required_iam_policy.return_value = {
         'foo': 'bar',
         'baz': 'blam',
     }
     self.cls.checker = mock_checker
     self.cls.iam_policy()
     out, err = capsys.readouterr()
     assert json.loads(out) == expected
     assert mock_checker.mock_calls == [
         call.get_required_iam_policy()
     ]