Skip to content

Commit 73ec6ae

Browse files
author
ravi
committed
added travis and coverall
1 parent 4ec802d commit 73ec6ae

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: python
2+
3+
python:
4+
- "2.7"
5+
- "3.2"
6+
- "3.3"
7+
- "3.4"
8+
- "3.5"
9+
10+
install:
11+
- python setup.py install
12+
- pip install nose
13+
- pip install coveralls
14+
script:
15+
- nosetests --with-coverage --cover-package=forex_python
16+
17+
after_success:
18+
coveralls

forex_python/converter.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import requests
2-
import datetime
32

43

54
class RatesNotAvailableError(Exception):
@@ -20,11 +19,8 @@ def _source_url(self):
2019
def _get_date_string(self, date_obj):
2120
if date_obj is None:
2221
return 'latest'
23-
try:
24-
date_str = date_obj.strftime('%Y-%m-%d')
25-
return date_str
26-
except ValueError:
27-
raise ValueError("Incorrect date String, date should be YYYY-MM-DD")
22+
date_str = date_obj.strftime('%Y-%m-%d')
23+
return date_str
2824

2925

3026
class CurrencyRates(Common):

0 commit comments

Comments
 (0)