Browse Source

Add a test case for filtering flips by timestamp

pull/504/head
Pēteris Caune 4 years ago
parent
commit
2831e5d7c1
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      hc/api/tests/test_get_flips.py

+ 7
- 0
hc/api/tests/test_get_flips.py View File

@ -64,6 +64,13 @@ class GetFlipsTestCase(BaseTestCase):
r = self.get(qs="?start=-123") r = self.get(qs="?start=-123")
self.assertEqual(r.status_code, 400) self.assertEqual(r.status_code, 400)
def test_it_filters_by_start(self):
r = self.get(qs="?start=1591014300") # 2020-06-01 12:25:00
self.assertEqual(r.status_code, 200)
doc = r.json()
self.assertEqual(doc["flips"], [])
def test_it_rejects_huge_start(self): def test_it_rejects_huge_start(self):
r = self.get(qs="?start=12345678901234567890") r = self.get(qs="?start=12345678901234567890")
self.assertEqual(r.status_code, 400) self.assertEqual(r.status_code, 400)


Loading…
Cancel
Save