Exemple #1
0
 def _add_claim(self, claim_id, content, date_str, post_type=None):
     claim = Claim()
     claim.claim_id = claim_id
     claim.verdict = post_type
     claim.title = claim_id
     claim.description = content
     claim.verdict_date = convert_str_to_unicode_datetime(date_str)
     claim.url = "claim url"
     self._db.addPost(claim)
Exemple #2
0
 def _add_post(self, post_id, content, tags, date_str, domain=u'Microblog'):
     post = Post()
     post.author = self._author.author_guid
     post.author_guid = self._author.author_guid
     post.content = content
     post.title = post_id
     post.domain = domain
     post.post_id = post_id
     post.guid = post.post_id
     post.date = convert_str_to_unicode_datetime(date_str)
     post.created_at = post.date
     post.tags = tags
     self._db.addPost(post)
     self._author.statuses_count += 1
 def _add_claim(self,
                claim_id,
                content,
                date_str=u"2017-06-14 05:00:00",
                keywords=u"",
                post_type=None):
     claim = Claim()
     claim.claim_id = claim_id
     claim.verdict = post_type
     claim.title = claim_id
     claim.description = content
     claim.verdict_date = convert_str_to_unicode_datetime(date_str)
     claim.keywords = keywords
     claim.url = u"claim url"
     self._db.addPost(claim)
     self._claim_dictionary[claim.claim_id] = claim
    def setUp(self):
        self._db = DB()
        self._db.setUp()
        self.author_guid = u"author_guid"

        author = Author()
        author.author_guid = self.author_guid
        author.author_full_name = u'author'
        author.name = u'author_name'
        author.author_screen_name = u'author_screen_name'
        author.domain = u'Microblog'
        author.statuses_count = 10
        author.friends_count = 5
        author.followers_count = 6
        author.favourites_count = 8
        author.author_sub_type = u"bot"
        author.author_type = u"bad"
        author.created_at = u"2017-06-17 05:00:00"
        author.default_profile = True
        author.default_profile_image = True
        author.verified = True
        self._db.add_author(author)

        post = Post()
        post.author = self.author_guid
        post.author_guid = self.author_guid
        post.content = u"content"
        post.title = u"title"
        post.domain = u"domain"
        post.post_id = u"post_id"
        post.guid = post.post_id
        post.date = convert_str_to_unicode_datetime("2017-06-14 05:00:00")
        post.created_at = post.date
        self._db.addPost(post)

        self._db.session.commit()
        self.feature_prefix = u"AccountPropertiesFeatureGenerator_"
        self.account_properties_feature_generator = AccountPropertiesFeatureGenerator(
            self._db, **{
                'authors': [author],
                'posts': {
                    self.author_guid: [post]
                }
            })
        self.account_properties_feature_generator.execute()
Exemple #5
0
 def _add_post(self,
               title,
               content,
               date_str,
               domain='Microblog',
               post_type=None):
     post = Post()
     post.author = self._author.author_guid
     post.author_guid = self._author.author_guid
     post.content = content
     post.title = title
     post.domain = domain
     post.post_id = title
     post.guid = post.post_id
     post.date = convert_str_to_unicode_datetime(date_str)
     post.created_at = post.date
     post.post_type = post_type
     self._db.addPost(post)
     self._posts.append(post)