-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
language: python | ||
notifications: | ||
email: true | ||
python: | ||
- "2.6" | ||
- "2.7" | ||
install: | ||
- "sudo apt-get install freetds-dev python-numpy python-matplotlib python-scipy python-pymssql -qq -y" | ||
- "easy_install -U setuptools" | ||
- "pip install --upgrade pip" | ||
- "pip install -r requirements.txt" | ||
- "pip install -r test_requirements.txt" | ||
script: | ||
- py.test test/test_glitch.py --doctest-modules -v --cov glitch --cov-report term-missing | ||
after_success: | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
numpy | ||
matplotlib | ||
pymssql | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Glitch unit tests | ||
""" | ||
import os | ||
import platform | ||
import csv | ||
import time | ||
import datetime | ||
import itertools | ||
import sys | ||
import math | ||
import types | ||
|
||
HERE = os.path.dirname(os.path.realpath(__file__)) | ||
sys.path.insert(0, os.path.join(HERE, os.pardir)) | ||
|
||
import glitch | ||
|
||
def test_drange(): | ||
expected = [ | ||
"2012-10-10 01:01:00", | ||
"2012-10-20 01:01:00", | ||
"2012-10-30 01:01:00", | ||
"2012-11-09 01:01:00", | ||
"2012-11-19 01:01:00", | ||
"2012-11-29 01:01:00", | ||
"2012-12-09 01:01:00", | ||
"2012-12-19 01:01:00", | ||
"2012-12-29 01:01:00", | ||
"2013-01-08 01:01:00", | ||
"2013-01-18 01:01:00", | ||
"2013-01-28 01:01:00", | ||
"2013-02-07 01:01:00", | ||
"2013-02-17 01:01:00", | ||
"2013-02-27 01:01:00", | ||
"2013-03-09 01:01:00", | ||
"2013-03-19 01:01:00", | ||
"2013-03-29 01:01:00", | ||
"2013-04-08 01:01:00", | ||
"2013-04-18 01:01:00", | ||
"2013-04-28 01:01:00", | ||
"2013-05-08 01:01:00", | ||
"2013-05-18 01:01:00", | ||
"2013-05-28 01:01:00", | ||
"2013-06-07 01:01:00", | ||
"2013-06-17 01:01:00", | ||
"2013-06-27 01:01:00", | ||
"2013-07-07 01:01:00", | ||
"2013-07-17 01:01:00", | ||
"2013-07-27 01:01:00", | ||
"2013-08-06 01:01:00", | ||
"2013-08-16 01:01:00", | ||
"2013-08-26 01:01:00", | ||
"2013-09-05 01:01:00", | ||
"2013-09-15 01:01:00", | ||
"2013-09-25 01:01:00", | ||
"2013-10-05 01:01:00", | ||
] | ||
|
||
start = datetime.datetime(2012, 10, 10, 1, 1) | ||
stop = datetime.datetime(2013, 10, 10, 1, 1) | ||
step = datetime.timedelta(days=10) | ||
drange_generator = glitch.drange(start, stop, step) | ||
assert(type(drange_generator) == types.GeneratorType) | ||
for i, d in enumerate(drange_generator): | ||
assert(str(d) == expected[i]) | ||
assert(i+1 == len(expected)) | ||
|
||
if __name__ == "__main__": | ||
test_drange() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pytest | ||
pytest-cov | ||
python-coveralls | ||
sh |