Example #1
0
 def tearDown(self):
     # Clear up the redis cache
     r_client.flushdb()
     # Remove any files that need to be remove
     for fp in self._clean_up_files:
         if exists(fp):
             remove(fp)
Example #2
0
 def tearDown(self):
     # Clear up the redis cache
     r_client.flushdb()
     # Remove any files that need to be remove
     for fp in self._clean_up_files:
         if exists(fp):
             remove(fp)
Example #3
0
    def tearDown(self):
        for f in self._clean_up_files:
            if exists(f):
                if isdir(f):
                    rmtree(f)
                else:
                    remove(f)

        r_client.flushdb()
Example #4
0
    def tearDown(self):
        for f in self._clean_up_files:
            if exists(f):
                if isdir(f):
                    rmtree(f)
                else:
                    remove(f)

        r_client.flushdb()
Example #5
0
    def tearDown(self):
        if exists(self.update_fp):
            remove(self.update_fp)

        fp = join(get_mountpoint("uploads")[0][1], '1', 'uploaded_file.txt')
        if not exists(fp):
            with open(fp, 'w') as f:
                f.write('')

        r_client.flushdb()
Example #6
0
    def tearDown(self):
        for fp in self._files_to_remove:
            if exists(fp):
                remove(fp)

        # Replace file if removed as part of function testing
        uploads_path = get_mountpoint('uploads')[0][1]
        fp = join(uploads_path, '1', 'uploaded_file.txt')
        if not exists(fp):
            with open(fp, 'w') as f:
                f.write('')

        r_client.flushdb()
Example #7
0
    def tearDown(self):
        for fp in self._files_to_remove:
            if exists(fp):
                remove(fp)

        # Replace file if removed as part of function testing
        uploads_path = get_mountpoint('uploads')[0][1]
        fp = join(uploads_path, '1', 'uploaded_file.txt')
        if not exists(fp):
            with open(fp, 'w') as f:
                f.write('')

        r_client.flushdb()
    def tearDown(self):
        base_dir = qdb.util.get_mountpoint('uploads')[0][1]
        fp = join(base_dir, '1', 'uploaded_file.txt')
        if not exists(fp):
            with open(fp, 'w') as f:
                f.write('')

        if exists(self.new_study_fp):
            remove(self.new_study_fp)

        r_client.flushdb()

        qdb.study.Study.delete(self.new_study.id)
Example #9
0
    def tearDown(self):
        base_dir = qdb.util.get_mountpoint('uploads')[0][1]
        fp = join(base_dir, '1', 'uploaded_file.txt')
        if not exists(fp):
            with open(fp, 'w') as f:
                f.write('')

        if exists(self.new_study_fp):
            remove(self.new_study_fp)

        r_client.flushdb()

        qdb.study.Study.delete(self.new_study.id)
Example #10
0
def drop_and_rebuild_tst_database():
    """Drops the qiita schema and rebuilds the test database
    """
    with qdb.sql_connection.TRN:
        r_client.flushdb()
        # Drop the schema
        qdb.sql_connection.TRN.add("DROP SCHEMA IF EXISTS qiita CASCADE")
        # Set the database to unpatched
        qdb.sql_connection.TRN.add(
            "UPDATE settings SET current_patch = 'unpatched'")
        # Create the database and apply patches
        create_layout_and_patch(test=True)

        qdb.sql_connection.TRN.execute()
def drop_and_rebuild_tst_database():
    """Drops the qiita schema and rebuilds the test database
    """
    with qdb.sql_connection.TRN:
        r_client.flushdb()
        # Drop the schema
        qdb.sql_connection.TRN.add("DROP SCHEMA IF EXISTS qiita CASCADE")
        # Set the database to unpatched
        qdb.sql_connection.TRN.add(
            "UPDATE settings SET current_patch = 'unpatched'")
        # Create the database and apply patches
        create_layout_and_patch(test=True)

        qdb.sql_connection.TRN.execute()
Example #12
0
def drop_and_rebuild_tst_database(drop_labcontrol=False):
    """Drops the qiita schema and rebuilds the test database

       Parameters
       ----------
       drop_labcontrol : bool
           Whether or not to drop labcontrol
    """
    with qdb.sql_connection.TRN:
        r_client.flushdb()
        # Drop the schema, note that we are also going to drop labman because
        # if not it will raise an error if you have both systems on your
        # computer due to foreing keys
        if drop_labcontrol:
            qdb.sql_connection.TRN.add("DROP SCHEMA IF EXISTS labman CASCADE")
        qdb.sql_connection.TRN.add("DROP SCHEMA IF EXISTS qiita CASCADE")
        # Set the database to unpatched
        qdb.sql_connection.TRN.add(
            "UPDATE settings SET current_patch = 'unpatched'")
        # Create the database and apply patches
        create_layout(test=True)
        patch(test=True)

        qdb.sql_connection.TRN.execute()
Example #13
0
def drop_and_rebuild_tst_database(drop_labcontrol=False):
    """Drops the qiita schema and rebuilds the test database

       Parameters
       ----------
       drop_labcontrol : bool
           Whether or not to drop labcontrol
    """
    with qdb.sql_connection.TRN:
        r_client.flushdb()
        # Drop the schema, note that we are also going to drop labman because
        # if not it will raise an error if you have both systems on your
        # computer due to foreing keys
        if drop_labcontrol:
            qdb.sql_connection.TRN.add("DROP SCHEMA IF EXISTS labman CASCADE")
        qdb.sql_connection.TRN.add("DROP SCHEMA IF EXISTS qiita CASCADE")
        # Set the database to unpatched
        qdb.sql_connection.TRN.add(
            "UPDATE settings SET current_patch = 'unpatched'")
        # Create the database and apply patches
        create_layout(test=True)
        patch(test=True)

        qdb.sql_connection.TRN.execute()
Example #14
0
 def tearDown(self):
     r_client.flushdb()
Example #15
0
    def tearDown(self):
        for fp in self._clean_up_files:
            if exists(fp):
                remove(fp)

        r_client.flushdb()
Example #16
0
 def tearDown(self):
     r_client.flushdb()
Example #17
0
 def tearDownClass(cls):
     clean_test_environment()
     r_client.flushdb()
Example #18
0
 def tearDownClass(cls):
     clean_test_environment()
     r_client.flushdb()