Example #1
0
    def test_keys_are_saved(self):
        Result = rss.create_object_with_wanted_parameters(
            self.TestDict, ["title", "parameter2", "parameter4"])
        ExpectedResult = {
            "title": "Title1",
            "parameter2": 2,
            "parameter4": [1, 2, 3, 4]
        }

        self.assertEqual(ExpectedResult, Result)
Example #2
0
 def search_for_notification(self):
     FeedContent = rss.open_feed(self.Feed)
     self.Entry = rss.search_method_switch(FeedContent, self.Search)
     Object = rss.create_object_with_wanted_parameters(
         self.Entry, self.StoreList)
     self.NotificationPending = rss.compare_notification_id(
         self.Name, Object)
     if self.Entry and self.NotificationPending:
         rss.save_object_as_json_to_disk(Object, self.Name)
         self.NotificationObject = rss.load_notification_object(self.Name)
Example #3
0
    def test_if_original_object_nonetype_return_empty_dic(self):
        Result = rss.create_object_with_wanted_parameters(None, ["title"])
        ExpectedResult = {}

        self.assertEqual(ExpectedResult, Result)
Example #4
0
    def test_returns_empty_dictionary_when_nothing_found(self):
        Result = rss.create_object_with_wanted_parameters(
            self.TestDict, ["does_not_exist"])
        ExpectedResult = {}

        self.assertEqual(ExpectedResult, Result)
Example #5
0
    def test_key_missing_from_original_object_throws_no_error(self):
        Result = rss.create_object_with_wanted_parameters(
            self.TestDict, ["title", "does_not_exist"])
        ExpectedResult = {"title": "Title1"}

        self.assertEqual(ExpectedResult, Result)