def test_list_services(self, capsys): expected = 'Bar\nFoo\n' mock_checker = Mock(spec_set=AwsLimitChecker) mock_checker.get_service_names.return_value = ['Foo', 'Bar'] self.cls.checker = mock_checker self.cls.list_services() out, err = capsys.readouterr() assert out == expected assert mock_checker.mock_calls == [call.get_service_names()]
def test_list_services(self, capsys): expected = 'Bar\nFoo\n' mock_checker = Mock(spec_set=AwsLimitChecker) mock_checker.get_service_names.return_value = [ 'Foo', 'Bar' ] self.cls.checker = mock_checker self.cls.list_services() out, err = capsys.readouterr() assert out == expected assert mock_checker.mock_calls == [ call.get_service_names() ]