コード例 #1
0
def get_nsfw_collections_srnames():
    all_collections = Collection.get_all()
    nsfw_collections = [col for col in all_collections if col.over_18]
    srnames = itertools.chain.from_iterable(col.sr_names
                                            for col in nsfw_collections)

    return set(srnames)
コード例 #2
0
ファイル: promote.py プロジェクト: pra85/reddit
def get_nsfw_collections_srnames():
    all_collections = Collection.get_all()
    nsfw_collections = [col for col in all_collections if col.over_18]
    srnames = itertools.chain.from_iterable(
        col.sr_names for col in nsfw_collections
    )

    return set(srnames)
コード例 #3
0
ファイル: promo_test.py プロジェクト: z0r0/saidit
 def _assert_scenario(self, unordered_collections):
     CollectionStorage.get_all.return_value = unordered_collections
     self.assertEqual(
         [collection.name for collection in Collection.get_all()],
         self.correct_order)