Exemplo n.º 1
0
def test_SCDB_gen_paths():
    """Check that gen_paths method of SCDB."""

    db = SCDB(auto_gen=False)
    db.gen_paths()

    assert db
Exemplo n.º 2
0
    def __init__(self):

        # Initialize from OMDB object
        SCDB.__init__(self, auto_gen=False)

        # Set up the base path to tests data
        self.project_path = pkg.resource_filename(__name__, 'data')
        self.gen_paths()
    def __init__(self):

        # Initialize from OMDB object
        SCDB.__init__(self, auto_gen=False)

        # Set up the base path to tests data
        self.project_path = pkg.resource_filename(__name__, 'data')
        self.gen_paths()
Exemplo n.º 4
0
def test_SCDB_paths():
    """Test that all defined SCDB paths exist."""

    db = SCDB()

    # Loops through all paths, checking they exist
    #  Skips vars without '_path' marker, and empty variables
    for key, val in vars(db).items():
        if '_path' in key and val:
            assert os.path.exists(val)
Exemplo n.º 5
0
def test_check_db():
    """Test the check_db function."""

    # Check that it returns an SCDB when given None
    db = check_db(None)
    assert isinstance(db, SCDB)

    # Check that it returns an SCDB object when given one
    db = SCDB()
    db = check_db(db)
    assert isinstance(db, SCDB)
Exemplo n.º 6
0
def test_SCDB():
    """Test the SCDB object."""

    # Check that SCDB returns properly.
    assert SCDB(auto_gen=False)
Exemplo n.º 7
0
def test_SCDB_gen_paths():

    db = SCDB(auto_gen=False)
    db.gen_paths()

    assert db
Exemplo n.º 8
0
def test_SCDB():

    assert SCDB(auto_gen=False)