Ejemplo n.º 1
0
    def test_metadata_none(self):
        reminder = Reminder.create_from_slot_values({
            METADATA_SLOT: None,
            PHONE_NUMBER_SLOT: PHONE_NUMBER,
            FIRST_NAME_SLOT: NAME,
        })
        expected_reminder = Reminder(timezone=None)
        expected_reminder.phone_number = PHONE_NUMBER
        expected_reminder.first_name = NAME

        self.assertEqual(reminder, expected_reminder)
Ejemplo n.º 2
0
    def test_create_from_slot_values(self):
        reminder = Reminder.create_from_slot_values({
            METADATA_SLOT: {
                TIMEZONE_PROPERTY: TIMEZONE
            },
            PHONE_NUMBER_SLOT: PHONE_NUMBER,
            FIRST_NAME_SLOT: NAME,
            "ignored_slot": "value",
        })
        expected_reminder = Reminder(TIMEZONE)
        expected_reminder.phone_number = PHONE_NUMBER
        expected_reminder.first_name = NAME

        self.assertEqual(reminder, expected_reminder)