text:
import ujson
from typing import Any, Mapping, List

from django.core.exceptions import ValidationError

from zerver.lib.actions import recipient_for_user_ids
from zerver.lib.test_helpers import tornado_redirected_to_list, get_display_recipient
from zerver.lib.test_classes import (
    ZulipTestCase,
)
from zerver.models import get_realm, get_user, get_display_recipient

class TypingNotificationOperatorTest(ZulipTestCase):
    def test_missing_parameter(self) -> None:
        """
        Sending typing notification without op parameter fails
        """
        sender = self.example_email("hamlet")
        recipient = self.example_email("othello")
        result = self.api_post(sender, '/api/v1/typing', {'to': recipient})
        self.assert_json_error(result, 'Missing \'op\' argument')

    def test_invalid_parameter(self) -> None:
        """
        Sending typing notification with invalid value for op parameter fails
        """
        sender = self.example_email("hamlet")
        recipient = self.example_email("othello")
        result = self.api_post(sender, '/api/v1/typing', {'to': recipient, 'op': 'foo'})
        self.assert_json_error(result, 'Invalid \'op\' value (should be start or stop)')

class TypingNotificationRecipientsTest(ZulipTestCase):
    def test_missing_recipient(self) -> None:
        """
        Sending typing notification without recipient fails
        """
        sender = self.example_email("hamlet")
        result = self.api_post(sender, '/api/v1/typing', {'op': 'start'})
        self.assert_json_error(result, 'Missing parameter: \'to\' (recipient)')

    def test_invalid_recipient(self) -> None:
        """
        Sending typing notification to invalid recipient fails
        """
        sender = self.example_email("hamlet")
        invalid = 'invalid email'
        result = self.api_post(sender, '/api/v1/typing', {'op': 'start', 'to': invalid})
        self.assert_json_error(result, 'Invalid email \'' + invalid + '\'')

    def test_single_recipient(self) -> None:
        """
        Sending typing notification to a single recipient is successful
        """
        sender = self.example_user('hamlet')
        recipient = self.example_user('othello')
        expected_recipients = set([sender, recipient])
        expected_recipient_emails = set([user.email for user in expected_recipients])
        expected_recipient_ids = set([user.id for user in expected_recipients])

        events = []  # type: List[Mapping[str, Any]]
        with tornado_redirected_to_list(events):
            result = self.api_post(sender.email, '/api/v1/typing', {'to': recipient.email,
                                                                    'op': 'start'})
        self.assert_json_success(result)
        self.assertEqual(len(events), 1)

        event = events[0]['event']
        event_recipient_emails = set(user['email'] for user in event['recipients'])
        event_user_ids = set(events[0]['users'])
        event_recipient_user_ids = set(user['user_id'] for user in event['recipients'])

        self.assertEqual(expected_recipient_ids, event_recipient_user_ids)
        self.assertEqual(expected_recipient_ids, event_user_ids)
        self.assertEqual(event['sender']['email'], sender.email)
        self.assertEqual(event_recipient_emails, expected_recipient_emails)
        self.assertEqual(event['type'], 'typing')
        self.assertEqual(event['op'], 'start')

    def test_multiple_recipients(self) -> None:
        """
        Sending typing notification to a single recipient is successful
        """
        sender = self.example_user('hamlet')
        recipient = [self.example_user('othello'), self.example_user('cordelia')]
        expected_recipients = set(recipient) | set([sender])
        expected_recipient_emails = set([user.email for user in expected_recipients])
        expected_recipient_ids = set([user.id for user in expected_recipients])
        events = []  # type: List[Mapping[str, Any]]
        with tornado_redirected_to_list(events):
            result = self.api_post(sender.email, '/api/v1/typing',
                                   {'to': ujson.dumps([user.email for user in recipient]),
                                    'op': 'start'})
        self.assert_json_success(result)
        self.assertEqual(len(events), 1)

        event = events[0]['event']
        event_recipient_emails = set(user['email'] for user in event['recipients'])
        event_user_ids = set(events[0]['users'])
        event_recipient_user_ids = set(user['user_id'] for user in event['recipients'])

        self.assertEqual(expected_recipient_ids, event_recipient_user_ids)
        self.assertEqual(expected_recipient_ids, event_user_ids)
        self.assertEqual(event['sender']['email'], sender.email)
        self.assertEqual(event_recipient_emails, expected_recipient_emails)
        self.assertEqual(event['type'], 'typing')
        self.assertEqual(event['op'], 'start')

class TypingStartedNotificationTest(ZulipTestCase):
    def test_send_notification_to_self_event(self) -> None:
        """
        Sending typing notification to yourself
        is successful.
        """
        user = self.example_user('hamlet')
        email = user.email
        expected_recipient_emails = set([email])
        expected_recipient_ids = set([user.id])
        events = []  # type: List[Mapping[str, Any]]
        with tornado_redirected_to_list(events):
            result = self.api_post(email, '/api/v1/typing', {'to': email,
                                                             'op': 'start'})
        self.assert_json_success(result)
        self.assertEqual(len(events), 1)

        event = events[0]['event']
        event_recipient_emails = set(user['email'] for user in event['recipients'])
        event_user_ids = set(events[0]['users'])
        event_recipient_user_ids = set(user['user_id'] for user in event['recipients'])

        self.assertEqual(expected_recipient_ids, event_recipient_user_ids)
        self.assertEqual(expected_recipient_ids, event_user_ids)
        self.assertEqual(event_recipient_emails, expected_recipient_emails)
        self.assertEqual(event['sender']['email'], email)
        self.assertEqual(event['type'], 'typing')
        self.assertEqual(event['op'], 'start')

    def test_send_notification_to_another_user_event(self) -> None:
        """
        Sending typing notification to another user
        is successful.
        """
        sender = self.example_user('hamlet')
        recipient = self.example_user('othello')
        expected_recipients = set([sender, recipient])
        expected_recipient_emails = set([user.email for user in expected_recipients])
        expected_recipient_ids = set([user.id for user in expected_recipients])

        events = []  # type: List[Mapping[str, Any]]
        with tornado_redirected_to_list(events):
            result = self.api_post(sender.email, '/api/v1/typing', {'to': recipient.email,
                                                                    'op': 'start'})
        self.assert_json_success(result)
        self.assertEqual(len(events), 1)

        event = events[0]['event']
        event_recipient_emails = set(user['email'] for user in event['recipients'])
        event_user_ids = set(events[0]['users'])
        event_recipient_user_ids = set(user['user_id'] for user in event['recipients'])

        self.assertEqual(expected_recipient_ids, event_recipient_user_ids)
        self.assertEqual(expected_recipient_ids, event_user_ids)
        self.assertEqual(event_recipient_emails, expected_recipient_emails)
        self.assertEqual(event['sender']['email'], sender.email)
        self.assertEqual(event['type'], 'typing')
        self.assertEqual(event['op'], 'start')

class StoppedTypingNotificationTest(ZulipTestCase):
    def test_send_notification_to_self_event(self) -> None:
        """
        Sending stopped typing notification to yourself
        is successful.
        """
        user = self.example_user('hamlet')
        email = user.email
        expected_recipient_emails = set([email])
        expected_recipient_ids = set([user.id])

        events = []  # type: List[Mapping[str, Any]]
        with tornado_redirected_to_list(events):
            result = self.api_post(email, '/api/v1/typing', {'to': email,
                                                             'op': 'stop'})
        self.assert_json_success(result)
        self.assertEqual(len(events), 1)

        event = events[0]['event']
        event_recipient_emails = set(user['email'] for user in event['recipients'])
        event_user_ids = set(events[0]['users'])
        event_recipient_user_ids = set(user['user_id'] for user in event['recipients'])

        self.assertEqual(expected_recipient_ids, event_recipient_user_ids)
        self.assertEqual(expected_recipient_ids, event_user_ids)
        self.assertEqual(event_recipient_emails, expected_recipient_emails)
        self.assertEqual(event['sender']['email'], email)
        self.assertEqual(event['type'], 'typing')
        self.assertEqual(event['op'], 'stop')

    def test_send_notification_to_another_user_event(self) -> None:
        """
        Sending stopped typing notification to another user
        is successful.
        """
        sender = self.example_user('hamlet')
        recipient = self.example_user('othello')
        expected_recipients = set([sender, recipient])
        expected_recipient_emails = set([user.email for user in expected_recipients])
        expected_recipient_ids = set([user.id for user in expected_recipients])

        events = []  # type: List[Mapping[str, Any]]
        with tornado_redirected_to_list(events):
            result = self.api_post(sender.email, '/api/v1/typing', {'to': recipient.email,
                                                                    'op': 'stop'})
        self.assert_json_success(result)
        self.assertEqual(len(events), 1)

        event = events[0]['event']
        event_recipient_emails = set(user['email'] for user in event['recipients'])
        event_user_ids = set(events[0]['users'])
        event_recipient_user_ids = set(user['user_id'] for user in event['recipients'])

        self.assertEqual(expected_recipient_ids, event_recipient_user_ids)
        self.assertEqual(expected_recipient_ids, event_user_ids)
        self.assertEqual(event_recipient_emails, expected_recipient_emails)
        self.assertEqual(event['sender']['email'], sender.email)
        self.assertEqual(event['type'], 'typing')
        self.assertEqual(event['op'], 'stop')

class TypingValidationHelpersTest(ZulipTestCase):
    def test_recipient_for_user_ids(self) -> None:
        hamlet = self.example_user('hamlet')
        othello = self.example_user('othello')
        cross_realm_bot = self.example_user('welcome_bot')
        sender = self.example_user('iago')
        recipient_user_ids = [hamlet.id, othello.id, cross_realm_bot.id]

        result = recipient_for_user_ids(recipient_user_ids, sender)
        recipient = get_display_recipient(result)
        recipient_ids = [recipient[0]['id'], recipient[1]['id'],  # type: ignore
                         recipient[2]['id'], recipient[3]['id']]  # type: ignore

        expected_recipient_ids = [hamlet.id, othello.id,
                                  sender.id, cross_realm_bot.id]
        self.assertEqual(set(recipient_ids), set(expected_recipient_ids))

    def test_recipient_for_user_ids_non_existent_id(self) -> None:
        sender = self.example_user('iago')
        recipient_user_ids = [999]

        with self.assertRaisesRegex(ValidationError, 'Invalid user ID '):
            recipient_for_user_ids(recipient_user_ids, sender)

redpajama_set_name: RedPajamaGithub


I like to surf heavy single fin boards and add my own style and twist to it to create a personal and unique way of surfing. I also like riding fishes, handplanes and my campervan. I admire people that put the environment over their personal desires and choices in life.
With my company 'Single Fin. Surf Travel' we organize exclusive trips with small amounts of people to beautiful natural areas with great longboarding waves. Our team is very passionate about longboarding and about sharing their vision and knowledge with others.


A home cannot be constructed into a dream house without a great set of home plans to construct it from. Iconfinder provides lovely icons to tons of of hundreds of designers and builders. Date regarding the happenings all throughout the. Iconfinder now hosts the worlds largest assortment of premium icons. D like to take care of everybody up. I Love Canine Industriveien 3A. WordPress open source enterprise and highlight how one can get. Nordic Retail Group AS Orgnummer. Go to our Journey Planner to find out in case your phone is capable of 4G LTE worldwide travel and to seek out extra details about coverage and pricing.
After you have purchased your private home, you will be assigned a private design guide who will guide you thru the particular choices available for your flooring plan. Then, as soon as your choices have been finalized, the development of your distinctive dwelling begins.
Residence Designer has a robust CAD software engine from Chief Architect that features an array of tools. Use the CAD tools with Flooring Plans, Cross Sections and Elevation Views to detail building drawings, then estimate and construct your tasks.
If a plan house is your preference, Shopping for a home off the plan shows which design options to look for. You possibly can usually customise your design to some extent. Use the filters on the left to find the home that fits your style. You may select between the type, measurement, number of bedrooms and price vary.
Instagram is an amazing social community, and these days I have been utilizing it as my primary supply for inside design and renovation inspiration. You'll find jaw-dropping pics from designers, architects, bloggers and householders from all over the world, and trust me — it doesn't take a lot to get misplaced down … Read More..
With over 20 unique designs ranging from 14 to 22 squares, the Good Residing Collection gives a number of fashionable, highly practical floor plans. As part of the item library, 3D design software program contains panorama objects. As with the overall object library, we counted every plant in every program's plant library. We additionally took notice of when these vegetation have been legitimate outside crops and when applications tended to only have indoor, potted plants. Sometimes, the extra objects in the plant library, the more choices it's important to make your gardens look precisely the way you envision.
Homebyme is a web-based 3D area planning service developed by Dassault Systemes SE brand. The services introduced on Homebyme are not bought by Dassault Systemes SE however referenced by companions who are solely liable for the merchandise, companies and informations related to those products and services.
Editor's Word: The manufacturer has knowledgeable us that House Designer Suite 2019 is now out there. Clicking the Visit Website button on this web page will take you to the new model. We are going to publish the new outcomes and review when we next test Home Design Software program.
If you understand which of our manufacturers you are significantly inquisitive about then make sure that you filter by that criteria. Our different manufacturers embody HomeSolution by Metricon, Freedom by Metricon, Signature by Metricon, Designer by Metricon in addition to DualOcc by Metricon. Whatever kind of home you are in search of, you may be sure to find something that fits you among our wide selection of house designs in Melbourne.
The complex planning controls of many local governments can have far reaching impacts on your design answer and must be negotiated. Your designer ought to have a sound data of those planning controls and a … Read More..
Browse through our kitchen design, lavatory design, bed room design, and additional living areas to create a sanctuary no matter the room. By providing your email deal with you might be consenting to receive advertising and marketing communications from Boutique Properties in future, on the understanding that you've got read and agree to our Privacy and Data Collection Statement and that you would be able to choose-out at any time.
Beyond offering an 'opinion of probable cost' that usually includes a range of probably prices, designers generally do not accept accountability for the final cost of your project as a result of monumental range of variables beyond their control. Shopping for off the plan can enhance funds certainty but reduce design flexibility.
Selecting the best dwelling for you and your family could be a robust resolution. A lot of our prospects come outfitted with a wish record that we're solely too blissful to accommodate. Finding that dream house inside your finances and timeframe is made simple with our Aspiration and Inspiration Sequence dwelling designs. Begin exploring what's on offer – we're confident you may discover something to tick all these boxes.
Homebyme is a web based 3D area planning service developed by Dassault Systemes SE model. The services and products offered on Homebyme will not be bought by Dassault Systemes SE but referenced by companions who're solely liable for the merchandise, providers and informations related to these services.
It's such a pleasure to view a home that's truly preferred and brought properly care of. When you look at the exterior of this house for the primary time you'll instantaneously realize it seems equally charming on the within. It is like seeing considerably boy or woman with a freshly scrubbed face, combed hair, big smile, and clear clothes. Helpful is simple … Read More..
Step contained in the KB Residence Design Studio and Uncover the perfect design and technology merchandise to personalize your new dwelling. Many French Nation house designs exhibit a sq., symmetrical form with windows balanced on either side of the doorway and a steep hipped roof. Others are asymmetrical, with a number of roof components to create a sequence of visible focal points. Spherical towers and entryways hidden beneath rustic arches are frequent decorative features. Stone, stucco, and brick are the prevailing decisions for the outside.
Choosing GHA to build your new Inexperienced dwelling is a great move on many ranges. A greater quality build, a extra stylish design, finely-tuned price effectivity, superior sustainability… bigger benefits for your loved ones all spherical, at no extra cost than an everyday home design. What's extra you are assured a easy, dependable, clearly defined timeframe to your construct.
Rooted in the rural French countryside, the French Nation style, often known as French Provencial, contains modest farmhouse designs with property-like chateaus. At its roots, the style shows a rustic warmth and comfy designs. These properties nuzzle in upscale suburban areas, the place their distinctive options make them an ideal match for many who want a residence with an unmatched sense of favor and attraction.
Our homes are designed to make sure that when you step inside you can't help but be impressed by the sleek, modern design and light-stuffed spaces. At Metricon, we create progressive and practical properties which might be designed to grow with your family. Our design philosophy has remained the identical since 1976 – to design a house you'd love to stay in that celebrates the variety of Australian life. Our designs continue to evolve, improve and innovate on the back of fixed analysis and improvement. With core rules of excellence and … Read More..
Flick thru our kitchen design, bathroom design, bedroom design, and additional dwelling areas to create a sanctuary regardless of the room. Useful flooring plans and progressive designs make it easy so that you can upgrade and adapt your family dwelling to fit your rising needs. And with an intensive list of luxury inclusions, T-Range homes provide 6-star dwelling at distinctive value for cash.
After you have decided which of our home designs you're keen on, then be sure to go to our itemizing of Display Properties to search out out in case your most popular homes are on display at any of the popular housing estates in Melbourne. If you can't make it to any of our shows then we are always ready to talk to you. In case you want any additional data or have any questions please contact us right now. We've helped many households throughout Melbourne construct their very personal dream residence, and we'd love so that you can join that growing record.
Candy Home 3D has a neat function that permits you to view the 2ND and 3D plans concurrently. As you place features and objects into your 2ND design, you'll be able to see them mechanically render in the 3D view. This cuts down on floating objects, a result of constructing in 2D that places objects high in your design fairly than flush to the bottom, which you'll be able to only see in a 3D view. This function additionally enables you to rapidly verify that every part is balanced.
Expertise our gentle-crammed modern designs close-up by exploring our show properties dotted proper throughout the Higher Melbourne area. Go to together with your favourite designs and interior style options and see the way it all suits together. Our friendly gross sales consultants may also be … Read More..