Exemplo n.º 1
0
 def test_shortcut(self):
     """ qiita should import Client, Items, Tags, Users. """
     from qiita import Client, Items, Tags, Users
     self.assertTrue(isinstance(Client(), Client))
     self.assertTrue(isinstance(Items(), Items))
     self.assertTrue(isinstance(Tags(), Tags))
     self.assertTrue(isinstance(Users(), Users))
Exemplo n.º 2
0
class TestTags(TestCase):
    def setUp(self):
        from qiita.tags import Tags
        self.tags = Tags()

    @patch('qiita.client.requests.get')
    def test_tag_items(self, m):
        """ Tags should get items search by tag. """
        dummy_response(m, 'data/tag_items.json')
        tags = self.tags.tag_items('python')
        self.assertTrue('body' in tags[0])
        self.assertTrue('uuid' in tags[0])

    @patch('qiita.client.requests.get')
    def test_get_tags(self, m):
        """ Tags should get tags. """
        dummy_response(m, 'data/tags.json')
        tags = self.tags.tags()
        self.assertTrue('name' in tags[0])
        self.assertTrue('url_name' in tags[0])
Exemplo n.º 3
0
class TestTags(TestCase):
    def setUp(self):
        from qiita.tags import Tags
        self.tags = Tags()

    @patch('qiita.client.requests.get')
    def test_tag_items(self, m):
        """ Tags should get items search by tag. """
        dummy_response(m, 'data/tag_items.json')
        tags = self.tags.tag_items('python')
        self.assertTrue('body' in tags[0])
        self.assertTrue('uuid' in tags[0])

    @patch('qiita.client.requests.get')
    def test_get_tags(self, m):
        """ Tags should get tags. """
        dummy_response(m, 'data/tags.json')
        tags = self.tags.tags()
        self.assertTrue('name' in tags[0])
        self.assertTrue('url_name' in tags[0])
Exemplo n.º 4
0
 def setUp(self):
     from qiita.tags import Tags
     self.tags = Tags()
Exemplo n.º 5
0
 def setUp(self):
     from qiita.tags import Tags
     self.tags = Tags()