File: test_it.py

package info (click to toggle)
python-hupper 1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 344 kB
  • sloc: python: 1,668; makefile: 149
file content (30 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os.path
import time

from . import util

here = os.path.abspath(os.path.dirname(__file__))


def test_myapp_reloads_when_touching_ini(testapp):
    testapp.start('myapp', ['--reload'])
    testapp.wait_for_response()
    time.sleep(2)
    util.touch(os.path.join(here, 'myapp/foo.ini'))
    testapp.wait_for_response()
    testapp.stop()

    assert len(testapp.response) == 2
    assert testapp.stderr != ''


def test_myapp_reloads_when_touching_pyfile(testapp):
    testapp.start('myapp', ['--reload'])
    testapp.wait_for_response()
    time.sleep(2)
    util.touch(os.path.join(here, 'myapp/cli.py'))
    testapp.wait_for_response()
    testapp.stop()

    assert len(testapp.response) == 2
    assert testapp.stderr != ''