def setUp(self): self.timeline_config = timeline_config() self.filter_config = filter_config() self.assert_timeline_config = timeline_config() self.assert_timeline_config['timestamp'] = '2019-03-10T13:57:52.432349' self.assert_filter_config = filter_config() self.assert_filter_config['timestamp'] = '2019-03-10T13:57:52.432349' self.changeset = Changeset() self.changeset['change_timestamp'] = '2019-03-10T13:57:52.432349'
def test_clean(self): self.changeset['update'] = { 'users': { '6253282': { 'since_id': '56789' }, '12345': { 'screen_name': 'foo' } } } self.changeset.clean_changeset(timeline_config()) self.assertDictEqual(extract_dict(self.changeset), { 'update': { 'users': { '6253282': { 'since_id': '56789' } } }, 'delete': [] })
def test_clean_no_users(self): self.changeset['update'] = {'users': {'12345': {'screen_name': 'foo'}}} self.changeset.clean_changeset(timeline_config()) self.assertFalse(self.changeset['update'])
def write_collection_config(self): os.makedirs(os.path.dirname(self.collection_config_filepath)) with open(self.collection_config_filepath, 'w') as file: json.dump(timeline_config(), file)
def setUp(self): self.timeline_config = timeline_config() self.filter_config = filter_config() self.other_timeline_config = timeline_config() self.other_filter_config = filter_config()
def setUp(self): self.timeline_config = timeline_config() self.filter_config = filter_config() self.search_config = search_config()