File: test_django_prometheus.py

package info (click to toggle)
django-prometheus 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 568 kB
  • sloc: python: 1,776; sh: 5; makefile: 3
file content (11 lines) | stat: -rw-r--r-- 427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python
from django_prometheus.utils import PowersOf


class TestDjangoPrometheus:
    def testPowersOf(self):
        """Tests utils.PowersOf."""
        assert PowersOf(2, 4) == [0, 1, 2, 4, 8]
        assert PowersOf(3, 5, lower=1) == [0, 3, 9, 27, 81, 243]
        assert PowersOf(2, 4, include_zero=False) == [1, 2, 4, 8]
        assert PowersOf(2, 6, lower=2, include_zero=False) == [4, 8, 16, 32, 64, 128]