Ejemplo n.º 1
0
    def test_delete(self):
        Collection.delete(1)

        obs = self.conn_handler.execute_fetchall(
            'SELECT * FROM qiita.collection')
        exp = []
        self.assertEqual(obs, exp)
Ejemplo n.º 2
0
    def test_create_no_desc(self):
        Collection.create(User('*****@*****.**'), 'Test Collection2')

        obs = self.conn_handler.execute_fetchall(
            'SELECT * FROM qiita.collection WHERE collection_id = 2')
        exp = [[2, '*****@*****.**', 'Test Collection2', None, 1]]
        self.assertEqual(obs, exp)
Ejemplo n.º 3
0
    def test_delete(self):
        Collection.delete(1)

        obs = self.conn_handler.execute_fetchall(
            'SELECT * FROM qiita.collection')
        exp = []
        self.assertEqual(obs, exp)
Ejemplo n.º 4
0
    def test_create_no_desc(self):
        Collection.create(User('*****@*****.**'), 'Test Collection2')

        obs = self.conn_handler.execute_fetchall(
            'SELECT * FROM qiita.collection WHERE collection_id = 2')
        exp = [[2, '*****@*****.**', 'Test Collection2', None, 1]]
        self.assertEqual(obs, exp)
Ejemplo n.º 5
0
    def test_delete_public(self):
        self.collection.status = 'public'
        with self.assertRaises(QiitaDBStatusError):
            Collection.delete(1)

        obs = self.conn_handler.execute_fetchall(
            'SELECT * FROM qiita.collection')
        exp = [[1, '*****@*****.**', 'TEST_COLLECTION',
                'collection for testing purposes', 2]]
        self.assertEqual(obs, exp)
Ejemplo n.º 6
0
    def test_delete_public(self):
        self.collection.status = 'public'
        with self.assertRaises(QiitaDBStatusError):
            Collection.delete(1)

        obs = self.conn_handler.execute_fetchall(
            'SELECT * FROM qiita.collection')
        exp = [[
            1, '*****@*****.**', 'TEST_COLLECTION',
            'collection for testing purposes', 2
        ]]
        self.assertEqual(obs, exp)
Ejemplo n.º 7
0
 def setUp(self):
     self.collection = Collection(1)