bug fix
This commit is contained in:
@@ -149,9 +149,11 @@ def create_c2_stroke_data_db(
|
|||||||
totalseconds += duration.second
|
totalseconds += duration.second
|
||||||
totalseconds += duration.microsecond/1.e6
|
totalseconds += duration.microsecond/1.e6
|
||||||
|
|
||||||
|
try:
|
||||||
spm = 60.*nr_strokes/totalseconds
|
spm = 60.*nr_strokes/totalseconds
|
||||||
|
except ZeroDivisionError:
|
||||||
|
spm = 20*zeros(nr_strokes)
|
||||||
|
|
||||||
step = totalseconds/float(nr_strokes)
|
step = totalseconds/float(nr_strokes)
|
||||||
|
|
||||||
elapsed = np.arange(nr_strokes)*totalseconds/(float(nr_strokes-1))
|
elapsed = np.arange(nr_strokes)*totalseconds/(float(nr_strokes-1))
|
||||||
|
|||||||
@@ -1070,13 +1070,29 @@ boattype: 4x
|
|||||||
a = MessageAttachment(message=m,document=a2[6:])
|
a = MessageAttachment(message=m,document=a2[6:])
|
||||||
a.save()
|
a.save()
|
||||||
|
|
||||||
|
m = Message(mailbox=workoutsbox,
|
||||||
|
from_header = u.email,
|
||||||
|
subject = "3x(5min/2min)/r2 \r2",
|
||||||
|
body = """
|
||||||
|
chart time
|
||||||
|
workout water
|
||||||
|
""")
|
||||||
|
m.save()
|
||||||
|
a2 = 'media/mailbox_attachments/colin2.csv'
|
||||||
|
copyfile('rowers/testdata/emails/colin.csv',a2)
|
||||||
|
a = MessageAttachment(message=m,document=a2[6:])
|
||||||
|
a.save()
|
||||||
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
for filename in os.listdir('media/mailbox_attachments'):
|
for filename in os.listdir('media/mailbox_attachments'):
|
||||||
path = os.path.join('media/mailbox_attachments/',filename)
|
path = os.path.join('media/mailbox_attachments/',filename)
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
os.remove(path)
|
try:
|
||||||
|
os.remove(path)
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
|
||||||
@patch('requests.get', side_effect=mocked_requests)
|
@patch('requests.get', side_effect=mocked_requests)
|
||||||
def test_emailprocessing(self, mock_get):
|
def test_emailprocessing(self, mock_get):
|
||||||
out = StringIO()
|
out = StringIO()
|
||||||
|
|||||||
Reference in New Issue
Block a user