Sfoglia il codice sorgente

added new test

pull/18/head
theycallmemac 3 anni fa
parent
commit
68abd88c9e
3 ha cambiato i file con 38 aggiunte e 0 eliminazioni
  1. +1
    -0
      .travis.yml
  2. +18
    -0
      CHANGELOG.md
  3. +19
    -0
      tests/test_builder.py

+ 1
- 0
.travis.yml Vedi File

@@ -9,6 +9,7 @@ install:

script:
- python tests/test_available_now.py
- python tests/test_builder.py

notifications:
email: false

+ 18
- 0
CHANGELOG.md Vedi File

@@ -224,3 +224,21 @@ __contributor:__ theycallmemac
dependencies used by dcurooms to be installed using TravisCI

---
---

__entry:__ 03-01-2018
__contributor:__ theycallmemac

---

- tests/test_builder.py
- created test_builder.py
- tests the return value of the build_timetable function in dcurooms.py
- also tests the validity of the url built

- .travis.yml
- added new test_builder.py test to scripts section

---


+ 19
- 0
tests/test_builder.py Vedi File

@@ -0,0 +1,19 @@

import unittest
import sys
import requests
sys.path.append('.')
from scripts.dcurooms import build_timetable
class BuildTimetableTestCase(unittest.TestCase):
def test_return_val(self):
val = build_timetable("CG04", "24", "14", "4")
self.assertEqual(type(val), tuple)

def test_url_builder(self):
tt, url = build_timetable("LG26", "4", "10", "1")
info = requests.get(url)
self.assertTrue('200', info.status_code)

if __name__ == '__main__':
unittest.main()


Caricamento…
Annulla
Salva