コード例 #1
0
ファイル: test_kuzuha.py プロジェクト: pombredanne/atango
def test_gen_params():
    """lib.kuzuha.datetime.datetime.nowにパッチ当てられなかったから他はパス
    """
    actual = kuzuha.gen_params('', {'date': '20131014'})
    desired = DEFAULT_PARAMS_DETAIL.copy()
    desired.update({'kwd': '', 'chk20131014.dat': 'checked', 'k': 'あ'})
    assert actual == desired
コード例 #2
0
ファイル: test_kuzuha.py プロジェクト: 5470x3/atango
def test_gen_params():
    """lib.kuzuha.datetime.datetime.nowにパッチ当てられなかったから他はパス
    """
    actual = kuzuha.gen_params('', {'date': '20131014'})
    desired = DEFAULT_PARAMS_DETAIL.copy()
    desired.update({
        'kwd': '',
        'chk20131014.dat': 'checked'
    })
    assert_equals(actual, desired)
コード例 #3
0
 def run(self):
     params = kuzuha.gen_params('', {'minute': 20})
     posts = kuzuha.get_log_as_dict('qwerty', params, url=True) or {}
     for (post_id, post) in posts.items():
         if 'date' not in post:
             continue
         stored_body = self.find(post_id)
         body = self.build_body(post, post_id)
         if body and body != stored_body:
             self.update(post_id, body, 'index')
         else:
             logger.debug('NO CHANGE: %s' % body)
     if self.actions:
         logger.info(helpers.bulk(self.es, self.actions))
         self.es.indices.refresh(index='qwerty')
コード例 #4
0
 def run(self):
     params = kuzuha.gen_params('', {'minute': 50})
     posts = kuzuha.get_log_as_dict('misao', params, url=True) or {}
     for (post_id, post) in posts.items():
         if 'date' not in post:
             continue
         stored_body = self.find(post_id)
         body = self.build_body(post, post_id)
         if body and body != stored_body:
             self.update(post_id, body, 'index')
         else:
             logger.debug('NO CHANGE: %s' % body)
     if self.actions:
         logger.info(helpers.bulk(self.es, self.actions))
         self.es.indices.refresh(index='misao')