Skip to content

Commit

Permalink
Merge pull request #32 from kelle/add_tests
Browse files Browse the repository at this point in the history
Add tests
  • Loading branch information
hover2pi committed Mar 23, 2016
2 parents 50a5031 + 3375e34 commit 9fe1a3d
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: python

python:
- '2.7'
- '3.3'
- '3.4'
- '3.5'

install:
- pip install astropy
- pip install matplotlib

script:
- py.test

matrix:
allow_failures:
- env: TRAVIS_PYTHON_VERSION=3.3
- env: TRAVIS_PYTHON_VERSION=3.4
- env: TRAVIS_PYTHON_VERSION=3.5
2 changes: 1 addition & 1 deletion astrodbkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from pkg_resources import get_distribution
__version__ = get_distribution('astrodbkit').version
__version__ = '0.3.0.post6'
Empty file added astrodbkit/tests/__init__.py
Empty file.
54 changes: 54 additions & 0 deletions astrodbkit/tests/test_astrodb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import pytest
import tempfile
import os
from astropy.utils.data import download_file
from .. import astrodb


def setup_module(module):
db_path = download_file("http://github.com/BDNYC/BDNYCdb/raw/master/BDNYCv1.0.db")
module.bdnyc_db = astrodb.Database(db_path)
filename = os.path.join(tempfile.mkdtemp(), 'empty_db.db')
module.empty_db = astrodb.create_database(filename)

def test_loaddb():
print(bdnyc_db)
print(empty_db)

def test_search():
bdnyc_db.search('1234','sources')

def test_inventory():
bdnyc_db.inventory(825)

def test_sqlquery():
bdnyc_db.query("SELECT s.id, s.ra, s.dec, s.shortname, p.source_id, p.band, p.magnitude "
"FROM sources as s JOIN photometry as p ON s.id=p.source_id "
"WHERE s.dec<=-10 AND p.band=='W1'")

def test_schema():
bdnyc_db.schema('sources')

@pytest.mark.xfail
def test_add_data():
assert False

@pytest.mark.xfail
def test_clean_up():
assert False

@pytest.mark.xfail
def test_merge():
assert False

@pytest.mark.xfail
def test_output_spectrum():
assert False

@pytest.mark.xfail
def test_plot_spectrum():
assert False

@pytest.mark.xfail
def test_table():
assert False
Empty file.
4 changes: 3 additions & 1 deletion setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
from codecs import open
from os import path

from astrodbkit import __version__

setup(
name='astrodbkit',
version='0.3.0.post6',
version=__version__,
description='Astronomy database management using SQL and Python',
url='https://github.com/BDNYC/astrodbkit.git',
author='Joe Filippazzo',
Expand Down

0 comments on commit 9fe1a3d

Please sign in to comment.