def test1(self):
        # check we get a None as we have no messages
        unannotated_message = self.ner_api.get_unannotated_message()
        self.assertEqual(unannotated_message, None)

        # add a tweet to the source_table
        self.insert_tweet(tweet1)
        self.check_we_have_only_n_record(self.source_table, 1)

        # check we get a valid unannotated message
        unannotated_message = self.ner_api.get_unannotated_message()
        self.assertNotEqual(unannotated_message, None)

        #from nose.tools import set_trace; set_trace()
        msg = unannotated_message[str('tweet_text')]
        api_result = self.ner_api.call_api(msg)
        self.assertTrue(api_result.startswith("NERAPICaller base"))

        self.ner_api.store_raw_response(unannotated_message, api_result)
        sql = "SELECT COUNT(*) FROM {}".format(self.destination_table)
        self.cursor.execute(sql)
        all_rows = self.cursor.fetchall()
        #from nose.tools import set_trace; set_trace()
        count = all_rows[0][0]
        self.assertEqual(count, 1, "Check we have 1 new record (we have {})".format(count))

        # check that we cannot store a duplicate item
        self.ner_api.store_raw_response(unannotated_message, api_result)
        sql = "SELECT COUNT(*) FROM {}".format(self.destination_table)
        self.cursor.execute(sql)
        all_rows = self.cursor.fetchall()
        #from nose.tools import set_trace; set_trace()
        count = all_rows[0][0]
        self.assertEqual(count, 1, "Check we have 1 new record (we have {})".format(count))
Click callback, converts values to lowercase.
dataset/ETHPy150Open ianozsvald/social_media_brand_disambiguator/ner_apis/test_ner_api_caller.py/Test.test1--crossover with--dataset/ETHPy150Open mapbox/rasterio/rasterio/rio/helpers.py/to_lower