Changeset b22a9d2 in OpenWorkouts-current
- Timestamp:
- Jan 19, 2019, 6:43:01 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- ceae158
- Parents:
- d33326a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/tests/models/test_workout.py
rd33326a rb22a9d2 514 514 workout = root['john']['1'] 515 515 # without tracking file 516 assert workout.has_tracking_file is False516 assert not workout.has_tracking_file 517 517 # with tracking file 518 518 workout.tracking_file = 'faked tracking file' 519 assert workout.has_tracking_file is True519 assert workout.has_tracking_file 520 520 521 521 def test_has_gpx(self, root): 522 522 workout = root['john']['1'] 523 523 # without tracking file 524 assert workout.has_gpx is False524 assert not workout.has_gpx 525 525 workout.tracking_filetype = 'fit' 526 assert workout.has_gpx is False526 assert not workout.has_gpx 527 527 # with non-gpx tracking file 528 528 workout.tracking_file = 'faked tracking file' 529 529 workout.tracking_filetype = 'fit' 530 assert workout.has_gpx is False530 assert not workout.has_gpx 531 531 # with gpx tracking file 532 532 workout.tracking_file = 'faked tracking file' 533 533 workout.tracking_filetype = 'gpx' 534 assert workout.has_gpx is True 534 assert workout.has_gpx 535 536 def test_has_fit(self, root): 537 workout = root['john']['1'] 538 # without tracking file 539 assert not workout.has_fit 540 # tracking_file is a fit, this should not happen, as uploading a fit 541 # puts the fit file into .fit_file and generates a gpx for 542 # .tracking_file 543 workout.tracking_file = 'faked tracking file' 544 workout.tracking_filetype = 'fit' 545 assert not workout.has_fit 546 # now, having a fit file returns true 547 workout.fit_file = 'faked fit file' 548 assert workout.has_fit 549 # no matter what we have in tracking_file 550 workout.tracking_filetype = 'gpx' 551 assert workout.has_fit 552 workout.tracking_file = None 553 workout.tracking_filetype = None 554 assert workout.has_fit
Note: See TracChangeset
for help on using the changeset viewer.