Пример #1
0
    def test_get_journals_by_jid_without_journal(self):
        """
        Testando controllers.get_journals_by_jid() sem journal, deve retornar
        None.
        """

        journals = controllers.get_journals_by_jid(['jid1', 'jid12', 'jid123'])

        self.assertIsNone(journals)
Пример #2
0
    def test_get_articles_by_aid_with_not_found_jids(self):
        """
        Testando a função controllers.get_articles_by_aid() deve retornar um
        None.
        """

        self._makeAny(items=5)

        self._makeOne(attrib={'_id': 'aid1'})
        self._makeOne(attrib={'_id': 'aid12'})
        self._makeOne(attrib={'_id': 'aid123'})

        self._makeAny(items=5)

        articles = controllers.get_journals_by_jid(['k8u1jid1', '0823mgjid12',
                                                   '-012-js7jid123'])

        self.assertIsNone(articles)
Пример #3
0
    def test_get_journals_by_jid_with_not_found_jids(self):
        """
        Testando a função controllers.get_journals_by_jid() deve retornar uma
        lista contendo objetos ``Journal`` .
        """

        self._makeAny(items=5)

        self._makeOne(attrib={'_id': 'jid1'})
        self._makeOne(attrib={'_id': 'jid12'})
        self._makeOne(attrib={'_id': 'jid123'})

        self._makeAny(items=5)

        journals = controllers.get_journals_by_jid(['k8u1jid1', '0823mgjid12',
                                                   '-012-js7jid123'])

        self.assertIsNone(journals)
Пример #4
0
    def test_get_journals_by_jid(self):
        """
        Testando a função controllers.get_journals_by_jid() deve retornar uma
        lista contendo objetos ``Journal`` .
        """

        self._makeAny(items=5)

        self._makeOne(attrib={'_id': 'jid1'})
        self._makeOne(attrib={'_id': 'jid12'})
        self._makeOne(attrib={'_id': 'jid123'})

        self._makeAny(items=5)

        journals = controllers.get_journals_by_jid(['jid1', 'jid12', 'jid123'])

        expected = [u'jid1', u'jid12', u'jid123']

        self.assertListEqual(sorted([journal for journal in journals.iterkeys()]),
                             sorted(expected))