Skip to content

Commit 92b2c86

Browse files
author
boraxpr
committed
bite 67
1 parent 05d5daa commit 92b2c86

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

67/calc_dts.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from datetime import date, timedelta
2+
3+
start_100days = date(2017, 3, 30)
4+
pybites_founded = date(2016, 12, 19)
5+
pycon_date = date(2018, 5, 8)
6+
7+
8+
def get_hundred_days_end_date():
9+
"""Return a string of yyyy-mm-dd"""
10+
end_date = start_100days + timedelta(days=100)
11+
return str(end_date)
12+
13+
14+
def get_days_between_pb_start_first_joint_pycon():
15+
"""Return the int number of days"""
16+
between = pycon_date - pybites_founded
17+
return int(between.days)
18+
19+
print(get_hundred_days_end_date())
20+
print(get_days_between_pb_start_first_joint_pycon())

67/test_calc_dts.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from calc_dts import (get_hundred_days_end_date,
2+
get_days_between_pb_start_first_joint_pycon)
3+
4+
5+
def test_get_hundred_days_end_date():
6+
assert get_hundred_days_end_date() == '2017-07-08'
7+
8+
9+
def test_get_days_till_pycon_meetup():
10+
assert get_days_between_pb_start_first_joint_pycon() == 505

0 commit comments

Comments
 (0)